From 7973eb9ff83ac788d15d52ff8f55acddc25bb464 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 3 Aug 2015 18:03:40 +0000 Subject: [PATCH] [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 --- unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); -- 2.34.1