From: Lang Hames Date: Mon, 3 Aug 2015 18:03:40 +0000 (+0000) Subject: [MCJIT] Fix a cast warning in the unit-test introduced in r243589. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7973eb9ff83ac788d15d52ff8f55acddc25bb464;p=oota-llvm.git [MCJIT] Fix a cast warning in the unit-test introduced in r243589. Thanks to Aaron Ballman for spotting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243891 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp index 9d768d97f38..cdc52a39b5f 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp @@ -514,7 +514,13 @@ TEST_F(MCJITCAPITest, addGlobalMapping) { buildMCJITOptions(); buildMCJITEngine(); - LLVMAddGlobalMapping(Engine, MappedFn, reinterpret_cast(&localTestFunc)); + union { + int (*raw)(); + void *usable; + } functionPointer; + functionPointer.raw = &localTestFunc; + + LLVMAddGlobalMapping(Engine, MappedFn, functionPointer.usable); buildAndRunPasses();