summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2019-10-01 09:20:36 +0000
committerClement Courbet <courbet@google.com>2019-10-01 09:20:36 +0000
commit8109901bf6c38f2bb04864f2fad2df723245a52c (patch)
tree5c368200caf8adbea29cf715fe8e270c78cffc3c /llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp
parentcf62871488486c6a76c71a3135af26e82a238822 (diff)
downloadbcm5719-llvm-8109901bf6c38f2bb04864f2fad2df723245a52c.tar.gz
bcm5719-llvm-8109901bf6c38f2bb04864f2fad2df723245a52c.zip
[llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.
Reviewers: gchatelet, a.sidorin Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68262 llvm-svn: 373313
Diffstat (limited to 'llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp
index d2ab6b434c4..562fd058b61 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetRepetitorTest.cpp
@@ -11,6 +11,7 @@
#include "LlvmState.h"
#include "MCInstrDescView.h"
#include "RegisterAliasing.h"
+#include "TestBase.h"
#include "Uops.h"
#include "X86InstrInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
@@ -28,18 +29,8 @@ using testing::Field;
using testing::Property;
using testing::UnorderedElementsAre;
-class X86SnippetRepetitorTest : public ::testing::Test {
+class X86SnippetRepetitorTest : public X86TestBase {
protected:
- X86SnippetRepetitorTest() : State("x86_64-unknown-linux", "haswell") {}
-
- static void SetUpTestCase() {
- LLVMInitializeX86TargetInfo();
- LLVMInitializeX86TargetMC();
- LLVMInitializeX86Target();
- LLVMInitializeX86AsmPrinter();
- InitializeX86ExegesisTarget();
- }
-
void SetUp() {
TM = State.createTargetMachine();
Context = std::make_unique<LLVMContext>();
@@ -60,7 +51,6 @@ protected:
static constexpr const unsigned kMinInstructions = 3;
- const LLVMState State;
std::unique_ptr<LLVMTargetMachine> TM;
std::unique_ptr<LLVMContext> Context;
std::unique_ptr<Module> Mod;
OpenPOWER on IntegriCloud