[llvm] r346493 - [llvm-exegesis] Fix unit tests on PowerPC/AArch64.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 9 06:08:29 PST 2018
Author: courbet
Date: Fri Nov 9 06:08:29 2018
New Revision: 346493
URL: http://llvm.org/viewvc/llvm-project?rev=346493&view=rev
Log:
[llvm-exegesis] Fix unit tests on PowerPC/AArch64.
We were comparing char*s and not contents. Introduced in rL346489.
Modified:
llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
llvm/trunk/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
Modified: llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp?rev=346493&r1=346492&r2=346493&view=diff
==============================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp (original)
+++ llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp Fri Nov 9 06:08:29 2018
@@ -60,9 +60,10 @@ TEST_F(AArch64TargetTest, SetRegToConsta
}
TEST_F(AArch64TargetTest, DefaultPfmCounters) {
- EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, "CPU_CYCLES");
+ const std::string Expected = "CPU_CYCLES";
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, Expected);
EXPECT_EQ(ExegesisTarget_->getPfmCounters("unknown_cpu").CycleCounter,
- "CPU_CYCLES");
+ Expected);
}
} // namespace
Modified: llvm/trunk/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp?rev=346493&r1=346492&r2=346493&view=diff
==============================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp (original)
+++ llvm/trunk/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp Fri Nov 9 06:08:29 2018
@@ -60,9 +60,10 @@ TEST_F(PowerPCTargetTest, SetRegToConsta
}
TEST_F(PowerPCTargetTest, DefaultPfmCounters) {
- EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, "CYCLES");
+ const std::string Expected = "CYCLES";
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, Expected);
EXPECT_EQ(ExegesisTarget_->getPfmCounters("unknown_cpu").CycleCounter,
- "CYCLES");
+ Expected);
}
} // namespace
More information about the llvm-commits
mailing list