[llvm] r342646 - [llvm-exegesis] Fix broken build bots.
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 20 06:37:04 PDT 2018
Author: gchatelet
Date: Thu Sep 20 06:37:04 2018
New Revision: 342646
URL: http://llvm.org/viewvc/llvm-project?rev=342646&view=rev
Log:
[llvm-exegesis] Fix broken build bots.
Reviewers: javed.absar
Subscribers: tschuett, courbet, llvm-commits
Differential Revision: https://reviews.llvm.org/D52302
Modified:
llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
llvm/trunk/unittests/tools/llvm-exegesis/X86/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=342646&r1=342645&r2=342646&view=diff
==============================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp (original)
+++ llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp Thu Sep 20 06:37:04 2018
@@ -22,9 +22,7 @@ using testing::IsEmpty;
using testing::Not;
using testing::NotNull;
-static const char kTriple[] = "aarch64-unknown-linux";
-static const char kGenericCpu[] = "generic";
-static const char kNoFeatures[] = "";
+constexpr const char kTriple[] = "aarch64-unknown-linux";
class AArch64TargetTest : public ::testing::Test {
protected:
@@ -35,7 +33,7 @@ protected:
Target_ = llvm::TargetRegistry::lookupTarget(kTriple, error);
EXPECT_THAT(Target_, NotNull());
STI_.reset(
- Target_->createMCSubtargetInfo(kTriple, kGenericCpu, kNoFeatures));
+ Target_->createMCSubtargetInfo(kTriple, "generic", /*no features*/ ""));
}
static void SetUpTestCase() {
Modified: llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp?rev=342646&r1=342645&r2=342646&view=diff
==============================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp (original)
+++ llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp Thu Sep 20 06:37:04 2018
@@ -99,22 +99,17 @@ Matcher<MCInst> IsStackDeallocate(unsign
ElementsAre(IsReg(llvm::X86::RSP), IsReg(llvm::X86::RSP), IsImm(Size)));
}
-static const char kTriple[] = "x86_64-unknown-linux";
-static const char kFeaturesEmpty[] = "";
-static const char kFeaturesAvx[] = "+avx";
-static const char kFeaturesAvx512VL[] = "+avx512vl";
-static const char kCpuCore2[] = "core2";
+constexpr const char kTriple[] = "x86_64-unknown-linux";
-template <const char *CPU, const char *Features>
class X86TargetTest : public ::testing::Test {
protected:
- X86TargetTest()
+ X86TargetTest(const char *Features)
: ExegesisTarget_(ExegesisTarget::lookup(llvm::Triple(kTriple))) {
EXPECT_THAT(ExegesisTarget_, NotNull());
std::string error;
Target_ = llvm::TargetRegistry::lookupTarget(kTriple, error);
EXPECT_THAT(Target_, NotNull());
- STI_.reset(Target_->createMCSubtargetInfo(kTriple, kCpuCore2, Features));
+ STI_.reset(Target_->createMCSubtargetInfo(kTriple, "core2", Features));
}
static void SetUpTestCase() {
@@ -133,9 +128,20 @@ protected:
std::unique_ptr<llvm::MCSubtargetInfo> STI_;
};
-using Core2TargetTest = X86TargetTest<kCpuCore2, kFeaturesEmpty>;
-using Core2AvxTargetTest = X86TargetTest<kCpuCore2, kFeaturesAvx>;
-using Core2Avx512TargetTest = X86TargetTest<kCpuCore2, kFeaturesAvx512VL>;
+class Core2TargetTest : public X86TargetTest {
+public:
+ Core2TargetTest() : X86TargetTest("") {}
+};
+
+class Core2AvxTargetTest : public X86TargetTest {
+public:
+ Core2AvxTargetTest() : X86TargetTest("+avx") {}
+};
+
+class Core2Avx512TargetTest : public X86TargetTest {
+public:
+ Core2Avx512TargetTest() : X86TargetTest("+avx512vl") {}
+};
TEST_F(Core2TargetTest, SetFlags) {
const unsigned Reg = llvm::X86::EFLAGS;
More information about the llvm-commits
mailing list