Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 69df0fe

Browse files
updated expected copy count for CopyCountGet test
1 parent d113304 commit 69df0fe

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

mlir/unittests/IR/AttributeTest.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,11 @@ TEST(CopyCountAttr, CopyCountGet) {
490490
test::CopyCount::counter = 0;
491491
test::TestCopyCountAttr::get(&context, std::move(copyCount));
492492
#ifndef NDEBUG
493-
// One verification enabled only in assert-mode requires a copy.
494-
EXPECT_EQ(counter1, 1);
495-
EXPECT_EQ(test::CopyCount::counter, 1);
493+
// One verification enabled only in assert-mode requires two copies: one for
494+
// calling 'verifyInvariants' and one for calling 'verify' inside
495+
// 'verifyInvariants'.
496+
EXPECT_EQ(counter1, 2);
497+
EXPECT_EQ(test::CopyCount::counter, 2);
496498
#else
497499
EXPECT_EQ(counter1, 0);
498500
EXPECT_EQ(test::CopyCount::counter, 0);
@@ -511,9 +513,10 @@ TEST(CopyCountAttr, CopyCountGetChecked) {
511513
int counter1 = test::CopyCount::counter;
512514
test::CopyCount::counter = 0;
513515
test::TestCopyCountAttr::getChecked(loc, &context, std::move(copyCount));
514-
// One verification requires a copy.
515-
EXPECT_EQ(counter1, 1);
516-
EXPECT_EQ(test::CopyCount::counter, 1);
516+
// The verifiers require two copies: one for calling 'verifyInvariants' and
517+
// one for calling 'verify' inside 'verifyInvariants'.
518+
EXPECT_EQ(counter1, 2);
519+
EXPECT_EQ(test::CopyCount::counter, 2);
517520
}
518521

519522
// Test stripped printing using test dialect attribute.

0 commit comments

Comments
 (0)