From d17bce2e9fb3861fd663c7464d9ec6110a0791a1 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Tue, 25 Nov 2014 18:03:08 +0000 Subject: [PATCH] Cleaning out google tests from MC. llvm-svn: 222770 --- llvm/unittests/MC/CMakeLists.txt | 6 --- llvm/unittests/MC/Hexagon/CMakeLists.txt | 14 ------ .../MC/Hexagon/HexagonMCCodeEmitterTest.cpp | 53 ---------------------- 3 files changed, 73 deletions(-) delete mode 100644 llvm/unittests/MC/Hexagon/CMakeLists.txt delete mode 100644 llvm/unittests/MC/Hexagon/HexagonMCCodeEmitterTest.cpp diff --git a/llvm/unittests/MC/CMakeLists.txt b/llvm/unittests/MC/CMakeLists.txt index c82bcde..f83eaf4 100644 --- a/llvm/unittests/MC/CMakeLists.txt +++ b/llvm/unittests/MC/CMakeLists.txt @@ -10,9 +10,3 @@ add_llvm_unittest(MCTests StringTableBuilderTest.cpp YAMLTest.cpp ) - -foreach(t ${LLVM_TARGETS_TO_BUILD}) - if (IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${t}") - add_subdirectory(${t}) - endif (IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${t}") -endforeach() diff --git a/llvm/unittests/MC/Hexagon/CMakeLists.txt b/llvm/unittests/MC/Hexagon/CMakeLists.txt deleted file mode 100644 index 6d4ee93a..0000000 --- a/llvm/unittests/MC/Hexagon/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(LLVM_LINK_COMPONENTS - HexagonCodeGen - HexagonDesc - HexagonInfo - MC - Support - ) - -include_directories (${LLVM_MAIN_SRC_DIR}/lib/Target/Hexagon) -include_directories (${LLVM_BINARY_DIR}/lib/Target/Hexagon) - -add_llvm_unittest(HexagonTests - HexagonMCCodeEmitterTest.cpp - ) diff --git a/llvm/unittests/MC/Hexagon/HexagonMCCodeEmitterTest.cpp b/llvm/unittests/MC/Hexagon/HexagonMCCodeEmitterTest.cpp deleted file mode 100644 index 958a21f..0000000 --- a/llvm/unittests/MC/Hexagon/HexagonMCCodeEmitterTest.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "gtest/gtest.h" - -#include - -#include "llvm/MC/MCCodeEmitter.h" -#include "llvm/MC/MCContext.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Support/TargetRegistry.h" -#include "llvm/Support/TargetSelect.h" - -#include "MCTargetDesc/HexagonMCInst.h" -#include "MCTargetDesc/HexagonMCTargetDesc.h" - -namespace { -class TestEmitter { -public: - TestEmitter() : Triple("hexagon-unknown-elf") { - LLVMInitializeHexagonTargetInfo(); - LLVMInitializeHexagonTarget(); - LLVMInitializeHexagonTargetMC(); - std::string error; - Target = llvm::TargetRegistry::lookupTarget("hexagon", error); - assert(Target != nullptr && "Expected to find target"); - assert(error.empty() && "Error should be empty if we have a target"); - RegisterInfo = Target->createMCRegInfo(Triple); - assert(RegisterInfo != nullptr && "Expecting to find register info"); - AsmInfo = Target->createMCAsmInfo(*RegisterInfo, Triple); - assert(AsmInfo != nullptr && "Expecting to find asm info"); - Context = new llvm::MCContext(AsmInfo, RegisterInfo, nullptr); - assert(Context != nullptr && "Expecting to create a context"); - Subtarget = Target->createMCSubtargetInfo(Triple, "hexagonv4", ""); - assert(Subtarget != nullptr && "Expecting to find a subtarget"); - InstrInfo = Target->createMCInstrInfo(); - assert(InstrInfo != nullptr && "Expecting to find instr info"); - Emitter = Target->createMCCodeEmitter(*InstrInfo, *RegisterInfo, *Subtarget, - *Context); - assert(Emitter != nullptr); - } - std::string Triple; - llvm::Target const *Target; - llvm::MCRegisterInfo *RegisterInfo; - llvm::MCAsmInfo *AsmInfo; - llvm::MCContext *Context; - llvm::MCSubtargetInfo *Subtarget; - llvm::MCInstrInfo *InstrInfo; - llvm::MCCodeEmitter *Emitter; -}; -TestEmitter Emitter; -} - -TEST(HexagonMCCodeEmitter, emitter_creation) { - ASSERT_NE(nullptr, Emitter.Emitter); -} -- 2.7.4