summaryrefslogtreecommitdiff
path: root/unittests/IR/AttributesTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-04-08 18:41:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-04-08 18:41:23 +0000
commit4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 (patch)
tree06099edc18d30894081a822b756f117cbe0b8207 /unittests/IR/AttributesTest.cpp
parent482e7bddf617ae804dc47133cb07eb4aa81e45de (diff)
Diffstat (limited to 'unittests/IR/AttributesTest.cpp')
-rw-r--r--unittests/IR/AttributesTest.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/unittests/IR/AttributesTest.cpp b/unittests/IR/AttributesTest.cpp
new file mode 100644
index 0000000000000..2368bdf94dc43
--- /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