[MCJIT] Fix a cast warning in the unit-test introduced in r243589.
authorLang Hames <lhames@gmail.com>
Mon, 3 Aug 2015 18:03:40 +0000 (18:03 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 3 Aug 2015 18:03:40 +0000 (18:03 +0000)
Thanks to Aaron Ballman for spotting this.

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

unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp

index 9d768d9..cdc52a3 100644 (file)
@@ -514,7 +514,13 @@ TEST_F(MCJITCAPITest, addGlobalMapping) {
   buildMCJITOptions();
   buildMCJITEngine();
 
-  LLVMAddGlobalMapping(Engine, MappedFn, reinterpret_cast<void*>(&localTestFunc));
+  union {
+    int (*raw)();
+    void *usable;
+  } functionPointer;
+  functionPointer.raw = &localTestFunc;
+
+  LLVMAddGlobalMapping(Engine, MappedFn, functionPointer.usable);
 
   buildAndRunPasses();