Differential Revision: https://reviews.llvm.org/D82295
}
bool AttributeImpl::operator<(const AttributeImpl &AI) const {
+ if (this == &AI)
+ return false;
// This sorts the attributes with Attribute::AttrKinds coming first (sorted
// relative to their enum value) and then strings.
if (isEnumAttribute()) {
Attribute ByVal = Attribute::get(C, Attribute::ByVal, Type::getInt32Ty(C));
EXPECT_FALSE(ByVal < Attribute::get(C, Attribute::ZExt));
EXPECT_TRUE(ByVal < Align4);
+ EXPECT_FALSE(ByVal < ByVal);
AttributeList ASs[] = {AttributeList::get(C, 2, Attribute::ZExt),
AttributeList::get(C, 1, Attribute::SExt)};