[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 9d768d97f389828f5495a1d241bf258c6f13696f..cdc52a39b5f24677f202cd093d600b8e080cd973 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();