diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:27:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:27:28 +0000 |
commit | ec304151b74f9254d7029ee4d197ce1f7cbe501a (patch) | |
tree | 63e4ed55e4fbb581fd4731d44a327a7b3278e0a1 /unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp | |
parent | 67c32a98315f785a9ec9d531c1f571a0196c7463 (diff) |
Diffstat (limited to 'unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp')
-rw-r--r-- | unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp index 62967bdd3270..f2a3000906e3 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp @@ -359,13 +359,10 @@ TEST_F(MCJITCAPITest, gva) { buildMCJITEngine(); buildAndRunPasses(); - union { - uint64_t raw; - int32_t *usable; - } valuePointer; - valuePointer.raw = LLVMGetGlobalValueAddress(Engine, "simple_value"); + uint64_t raw = LLVMGetGlobalValueAddress(Engine, "simple_value"); + int32_t *usable = (int32_t *) raw; - EXPECT_EQ(42, *valuePointer.usable); + EXPECT_EQ(42, *usable); } TEST_F(MCJITCAPITest, gfa) { @@ -376,13 +373,10 @@ TEST_F(MCJITCAPITest, gfa) { buildMCJITEngine(); buildAndRunPasses(); - union { - uint64_t raw; - int (*usable)(); - } functionPointer; - functionPointer.raw = LLVMGetFunctionAddress(Engine, "simple_function"); + uint64_t raw = LLVMGetFunctionAddress(Engine, "simple_function"); + int (*usable)() = (int (*)()) raw; - EXPECT_EQ(42, functionPointer.usable()); + EXPECT_EQ(42, usable()); } TEST_F(MCJITCAPITest, custom_memory_manager) { |