[PATCH] D52302: [llvm-exegesis] Fix broken build bots.
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 20 06:38:37 PDT 2018
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL342646: [llvm-exegesis] Fix broken build bots. (authored by gchatelet, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D52302
Files:
llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
Index: llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
===================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
+++ llvm/trunk/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
@@ -22,9 +22,7 @@
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 @@
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() {
Index: llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
===================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
+++ llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
@@ -99,22 +99,17 @@
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 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52302.166281.patch
Type: text/x-patch
Size: 2942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180920/b8e1ff8c/attachment.bin>
More information about the llvm-commits
mailing list