Skip to content

Commit

Permalink
Fix fmt + 1 more test
Browse files Browse the repository at this point in the history
  • Loading branch information
goldsteinn committed Oct 2, 2024
1 parent ebc4a92 commit bdbc0ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/IR/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,9 +1802,9 @@ AttributeList::intersectWith(LLVMContext &C, AttributeList Other) const {
return *this;

SmallVector<std::pair<unsigned, AttributeSet>> 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.
Expand Down
8 changes: 7 additions & 1 deletion llvm/unittests/IR/AttributesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ TEST(Attributes, SetIntersectByValAlign) {

TEST(Attributes, ListIntersectDifferingMustPreserve) {
LLVMContext C;
fprintf(stderr, "Starting Test!\n");
std::optional<AttributeList> Res;
{
AttributeList AL0;
Expand All @@ -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());
}
}

Expand Down

0 comments on commit bdbc0ee

Please sign in to comment.