Cleaning out google tests from MC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Colin LeMahieu 2014-11-25 18:03:08 +00:00
parent 4d48c3f1aa
commit 04871e9c9b
3 changed files with 0 additions and 73 deletions

View File

@ -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()

View File

@ -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
)

View File

@ -1,53 +0,0 @@
#include "gtest/gtest.h"
#include <memory>
#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);
}