From 169d2bd06003c39970bc94c99669a34b61bb7e45 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:41:23 +0000 Subject: Vendor import of llvm trunk r178860: http://llvm.org/svn/llvm-project/llvm/trunk@178860 --- unittests/IR/AttributesTest.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 unittests/IR/AttributesTest.cpp (limited to 'unittests/IR/AttributesTest.cpp') diff --git a/unittests/IR/AttributesTest.cpp b/unittests/IR/AttributesTest.cpp new file mode 100644 index 0000000..2368bdf --- /dev/null +++ b/unittests/IR/AttributesTest.cpp @@ -0,0 +1,34 @@ +//===- llvm/unittest/IR/AttributesTest.cpp - Attributes unit tests --------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/IR/Attributes.h" +#include "llvm/IR/LLVMContext.h" +#include "gtest/gtest.h" +using namespace llvm; + +namespace { + +TEST(Attributes, Uniquing) { + LLVMContext C; + + Attribute AttrA = Attribute::get(C, Attribute::AlwaysInline); + Attribute AttrB = Attribute::get(C, Attribute::AlwaysInline); + EXPECT_EQ(AttrA, AttrB); + + AttributeSet ASs[] = { + AttributeSet::get(C, 1, Attribute::ZExt), + AttributeSet::get(C, 2, Attribute::SExt) + }; + + AttributeSet SetA = AttributeSet::get(C, ASs); + AttributeSet SetB = AttributeSet::get(C, ASs); + EXPECT_EQ(SetA, SetB); +} + +} // end anonymous namespace -- cgit v1.1