aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData/InstrProfTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-11-20 12:58:07 -0800
committerGitHub <noreply@github.com>2024-11-20 12:58:07 -0800
commite468653ee77cd8e0268e5e8d83d5430114f1f4c8 (patch)
treecaeb66ee004ffa8328d9fbc716408390591aa9d1 /llvm/unittests/ProfileData/InstrProfTest.cpp
parent19f58e3cbe92d8bcf281a6fb95e6ed62722f2a13 (diff)
downloadllvm-e468653ee77cd8e0268e5e8d83d5430114f1f4c8.zip
llvm-e468653ee77cd8e0268e5e8d83d5430114f1f4c8.tar.gz
llvm-e468653ee77cd8e0268e5e8d83d5430114f1f4c8.tar.bz2
[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
Diffstat (limited to 'llvm/unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/InstrProfTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp
index 5a313aa..3beab89 100644
--- a/llvm/unittests/ProfileData/InstrProfTest.cpp
+++ b/llvm/unittests/ProfileData/InstrProfTest.cpp
@@ -25,8 +25,10 @@
#include <optional>
using namespace llvm;
+using ::llvm::memprof::LineLocation;
using ::testing::EndsWith;
using ::testing::IsSubsetOf;
+using ::testing::Pair;
using ::testing::SizeIs;
using ::testing::UnorderedElementsAre;
@@ -620,18 +622,18 @@ TEST_F(InstrProfTest, test_caller_callee_pairs) {
auto It = Pairs.find(0x123);
ASSERT_NE(It, Pairs.end());
ASSERT_THAT(It->second, SizeIs(2));
- EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(1U, 2U), 0x234U));
- EXPECT_THAT(It->second[1], testing::Pair(testing::FieldsAre(5U, 6U), 0x345U));
+ EXPECT_THAT(It->second[0], Pair(LineLocation(1, 2), 0x234U));
+ EXPECT_THAT(It->second[1], Pair(LineLocation(5, 6), 0x345U));
It = Pairs.find(0x234);
ASSERT_NE(It, Pairs.end());
ASSERT_THAT(It->second, SizeIs(1));
- EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(3U, 4U), 0U));
+ EXPECT_THAT(It->second[0], Pair(LineLocation(3, 4), 0U));
It = Pairs.find(0x345);
ASSERT_NE(It, Pairs.end());
ASSERT_THAT(It->second, SizeIs(1));
- EXPECT_THAT(It->second[0], testing::Pair(testing::FieldsAre(7U, 8U), 0U));
+ EXPECT_THAT(It->second[0], Pair(LineLocation(7, 8), 0U));
}
TEST_F(InstrProfTest, test_memprof_getrecord_error) {