1 //===-- TestBase.h ----------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // Test fixture common to all Mips tests. 9 //===----------------------------------------------------------------------===// 10 11 #ifndef LLVM_UNITTESTS_TOOLS_LLVMEXEGESIS_MIPS_TESTBASE_H 12 #define LLVM_UNITTESTS_TOOLS_LLVMEXEGESIS_MIPS_TESTBASE_H 13 14 #include "LlvmState.h" 15 #include "llvm/Support/TargetRegistry.h" 16 #include "llvm/Support/TargetSelect.h" 17 #include "gmock/gmock.h" 18 #include "gtest/gtest.h" 19 20 namespace llvm { 21 namespace exegesis { 22 23 void InitializeMipsExegesisTarget(); 24 25 class MipsTestBase : public ::testing::Test { 26 protected: MipsTestBase()27 MipsTestBase() : State("mips-unknown-linux", "mips32") {} 28 SetUpTestCase()29 static void SetUpTestCase() { 30 LLVMInitializeMipsTargetInfo(); 31 LLVMInitializeMipsTargetMC(); 32 LLVMInitializeMipsTarget(); 33 InitializeMipsExegesisTarget(); 34 } 35 36 const LLVMState State; 37 }; 38 39 } // namespace exegesis 40 } // namespace llvm 41 42 #endif 43