diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 63dfdacbcd169c..0fe213e95e50a9 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -1802,9 +1802,9 @@ AttributeList::intersectWith(LLVMContext &C, AttributeList Other) const { return *this; SmallVector> IntersectedAttrs; - auto IndexIt = index_iterator(std::max(getNumAttrSets(), Other.getNumAttrSets())); + auto IndexIt = + index_iterator(std::max(getNumAttrSets(), Other.getNumAttrSets())); for (unsigned Idx : IndexIt) { - fprintf(stderr, "Checking Idx: %u\n", Idx); auto IntersectedAS = getAttributes(Idx).intersectWith(C, Other.getAttributes(Idx)); // If any index fails to intersect, fail. diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp index a627bddd64a3e3..f73f2b20e9fea5 100644 --- a/llvm/unittests/IR/AttributesTest.cpp +++ b/llvm/unittests/IR/AttributesTest.cpp @@ -598,7 +598,6 @@ TEST(Attributes, SetIntersectByValAlign) { TEST(Attributes, ListIntersectDifferingMustPreserve) { LLVMContext C; - fprintf(stderr, "Starting Test!\n"); std::optional Res; { AttributeList AL0; @@ -619,6 +618,13 @@ TEST(Attributes, ListIntersectDifferingMustPreserve) { ASSERT_FALSE(Res.has_value()); Res = AL1.intersectWith(C, AL0); ASSERT_FALSE(Res.has_value()); + + AL0 = AL0.addFnAttribute(C, Attribute::AlwaysInline); + AL1 = AL1.addParamAttribute(C, 1, Attribute::SExt); + Res = AL0.intersectWith(C, AL1); + ASSERT_FALSE(Res.has_value()); + Res = AL1.intersectWith(C, AL0); + ASSERT_FALSE(Res.has_value()); } }