[llvm] r243891 - [MCJIT] Fix a cast warning in the unit-test introduced in r243589.

Lang Hames lhames at gmail.com
Mon Aug 3 11:03:41 PDT 2015


Author: lhames
Date: Mon Aug  3 13:03:40 2015
New Revision: 243891

URL: http://llvm.org/viewvc/llvm-project?rev=243891&view=rev
Log:
[MCJIT] Fix a cast warning in the unit-test introduced in r243589.

Thanks to Aaron Ballman for spotting this.

Modified:
    llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp

Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp?rev=243891&r1=243890&r2=243891&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp Mon Aug  3 13:03:40 2015
@@ -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();
 





More information about the llvm-commits mailing list