From 6190625381bd6c47765ecdc922466700f5ece5a6 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 19 Apr 2017 01:51:13 +0000 Subject: Remove buggy 'addAttributes(unsigned, AttrBuilder)' overload The 'addAttributes(unsigned, AttrBuilder)' overload delegated to 'get' instead of 'addAttributes'. Since we can implicitly construct an AttrBuilder from an AttributeSet, just standardize on AttrBuilder. llvm-svn: 300651 --- llvm/unittests/IR/AttributesTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/unittests/IR/AttributesTest.cpp') diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp index c9c8cb75ebf..7c3df2e19e8 100644 --- a/llvm/unittests/IR/AttributesTest.cpp +++ b/llvm/unittests/IR/AttributesTest.cpp @@ -56,6 +56,11 @@ TEST(Attributes, AddAttributes) { 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 -- cgit v1.2.3