if (!AS.hasAttributes())
return *this;
+ if (!pImpl)
+ return AttributeList::get(C, {{Index, AS}});
+
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment. For now, say
// we can't change a known alignment.
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