summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.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/SnippetFileTest.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/SnippetFileTest.cpp')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
index d4773fc134d..69dd689fc49 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
@@ -9,6 +9,7 @@
#include "SnippetFile.h"
#include "LlvmState.h"
+#include "TestBase.h"
#include "X86InstrInfo.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
@@ -33,19 +34,8 @@ using testing::Field;
using testing::Property;
using testing::SizeIs;
-class X86SnippetFileTest : public ::testing::Test {
+class X86SnippetFileTest : public X86TestBase {
protected:
- X86SnippetFileTest() : State("x86_64-unknown-linux", "haswell") {}
-
- static void SetUpTestCase() {
- LLVMInitializeX86TargetInfo();
- LLVMInitializeX86TargetMC();
- LLVMInitializeX86Target();
- LLVMInitializeX86AsmPrinter();
- LLVMInitializeX86AsmParser();
- InitializeX86ExegesisTarget();
- }
-
Expected<std::vector<BenchmarkCode>> TestCommon(StringRef Contents) {
SmallString<64> Filename;
std::error_code EC;
@@ -60,8 +50,6 @@ protected:
}
return readSnippets(State, Filename);
}
-
- const LLVMState State;
};
// FIXME: Refactor these to ../Common/Matchers.h
OpenPOWER on IntegriCloud