diff options
author | Reid Kleckner <rnk@google.com> | 2017-04-18 22:10:18 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-04-18 22:10:18 +0000 |
commit | fe64c0137e69a7d4c7d9c451357b1216d5ff6bed (patch) | |
tree | e17f5a4fdfa2be4c9088b5f503d55d50cddeb1fc /llvm/unittests/IR/AttributesTest.cpp | |
parent | f09c1e346e2f8bc8b811264e922731ff65e6d87d (diff) | |
download | bcm5719-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.cpp | 9 |
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 |