Fix MCJITCAPITest.cpp unit test on Windows.
authorAndrew Kaylor <andrew.kaylor@intel.com>
Fri, 10 May 2013 17:58:41 +0000 (17:58 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Fri, 10 May 2013 17:58:41 +0000 (17:58 +0000)
MCJIT on Windows requires an explicit target triple with "-elf" appended to generate objects in ELF format.  The common test framework was setting up this triple, but it wasn't passed to the C API in the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181614 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp

index d8cf6c592d3b3e91000a6bef6ecbfa7a38b67fad..07ea1afe1a85f69f1746bb7e3c05140a38d0da04 100644 (file)
@@ -48,6 +48,8 @@ TEST_F(MCJITCAPITest, simple_function) {
   // Creates a function that returns 42, compiles it, and runs it.
   
   LLVMModuleRef module = LLVMModuleCreateWithName("simple_module");
+
+  LLVMSetTarget(module, HostTriple.c_str());
   
   LLVMValueRef function = LLVMAddFunction(
     module, "simple_function", LLVMFunctionType(LLVMInt32Type(), 0, 0, 0));