Skip to content

Commit e468653

Browse files
[memprof] Use LineLocation in a unit test (NFC) (#117031)
We've switched to LineLocation from FieldsAre in MemProfUseTest.cpp. This patch does the same thing in InstrProfTest.cpp. llvm/unittests/Transforms/Instrumentation/MemProfUseTest.cpp
1 parent 19f58e3 commit e468653

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
#include <optional>
2626

2727
using namespace llvm;
28+
using ::llvm::memprof::LineLocation;
2829
using ::testing::EndsWith;
2930
using ::testing::IsSubsetOf;
31+
using ::testing::Pair;
3032
using ::testing::SizeIs;
3133
using ::testing::UnorderedElementsAre;
3234

@@ -620,18 +622,18 @@ TEST_F(InstrProfTest, test_caller_callee_pairs) {
620622
auto It = Pairs.find(0x123);
621623
ASSERT_NE(It, Pairs.end());
622624
ASSERT_THAT(It->second, SizeIs(2));
623-
EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(1U, 2U), 0x234U));
624-
EXPECT_THAT(It->second[1], testing::Pair(testing::FieldsAre(5U, 6U), 0x345U));
625+
EXPECT_THAT(It->second[0], Pair(LineLocation(1, 2), 0x234U));
626+
EXPECT_THAT(It->second[1], Pair(LineLocation(5, 6), 0x345U));
625627

626628
It = Pairs.find(0x234);
627629
ASSERT_NE(It, Pairs.end());
628630
ASSERT_THAT(It->second, SizeIs(1));
629-
EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(3U, 4U), 0U));
631+
EXPECT_THAT(It->second[0], Pair(LineLocation(3, 4), 0U));
630632

631633
It = Pairs.find(0x345);
632634
ASSERT_NE(It, Pairs.end());
633635
ASSERT_THAT(It->second, SizeIs(1));
634-
EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(7U, 8U), 0U));
636+
EXPECT_THAT(It->second[0], Pair(LineLocation(7, 8), 0U));
635637
}
636638

637639
TEST_F(InstrProfTest, test_memprof_getrecord_error) {

0 commit comments

Comments
 (0)