summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/AttributesTest.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-18 22:10:18 +0000
committerReid Kleckner <rnk@google.com>2017-04-18 22:10:18 +0000
commitfe64c0137e69a7d4c7d9c451357b1216d5ff6bed (patch)
treee17f5a4fdfa2be4c9088b5f503d55d50cddeb1fc /llvm/unittests/IR/AttributesTest.cpp
parentf09c1e346e2f8bc8b811264e922731ff65e6d87d (diff)
downloadbcm5719-llvm-fe64c0137e69a7d4c7d9c451357b1216d5ff6bed.tar.gz
bcm5719-llvm-fe64c0137e69a7d4c7d9c451357b1216d5ff6bed.zip
Fix crash in AttributeList::addAttributes, add test
llvm-svn: 300614
Diffstat (limited to 'llvm/unittests/IR/AttributesTest.cpp')
-rw-r--r--llvm/unittests/IR/AttributesTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp
index b5b221c63a1..c9c8cb75ebf 100644
--- a/llvm/unittests/IR/AttributesTest.cpp
+++ b/llvm/unittests/IR/AttributesTest.cpp
@@ -49,4 +49,13 @@ 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));
+}
+
} // end anonymous namespace
OpenPOWER on IntegriCloud