aboutsummaryrefslogtreecommitdiff
path: root/unittests/IR/AttributesTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/IR/AttributesTest.cpp')
-rw-r--r--unittests/IR/AttributesTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/unittests/IR/AttributesTest.cpp b/unittests/IR/AttributesTest.cpp
index b5b221c63a17..7c3df2e19e8f 100644
--- a/unittests/IR/AttributesTest.cpp
+++ b/unittests/IR/AttributesTest.cpp
@@ -49,4 +49,18 @@ TEST(Attributes, Ordering) {
EXPECT_NE(SetA, SetB);
}
+TEST(Attributes, AddAttributes) {
+ LLVMContext C;
+ AttributeList AL;
+ AttrBuilder B;
+ B.addAttribute(Attribute::NoReturn);
+ AL = AL.addAttributes(C, AttributeList::FunctionIndex, AttributeSet::get(C, B));
+ EXPECT_TRUE(AL.hasFnAttribute(Attribute::NoReturn));
+ B.clear();
+ B.addAttribute(Attribute::SExt);
+ AL = AL.addAttributes(C, AttributeList::ReturnIndex, B);
+ EXPECT_TRUE(AL.hasAttribute(AttributeList::ReturnIndex, Attribute::SExt));
+ EXPECT_TRUE(AL.hasFnAttribute(Attribute::NoReturn));
+}
+
} // end anonymous namespace