diff options
Diffstat (limited to 'llvm/unittests/ExecutionEngine')
4 files changed, 15 insertions, 20 deletions
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp index c84a16bf687..65f969f24c6 100644 --- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp +++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp @@ -1,4 +1,4 @@ -//===- MCJITMultipeModuleTest.cpp - Unit tests for the MCJIT-----*- C++ -*-===// +//===- MCJITMultipeModuleTest.cpp - Unit tests for the MCJIT ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -228,13 +228,13 @@ TEST_F(MCJITMultipleModuleTest, two_module_global_variables_case) { uint64_t FBPtr = TheJIT->getFunctionAddress(FB->getName().str()); TheJIT->finalizeObject(); EXPECT_TRUE(0 != FBPtr); - int32_t(*FuncPtr)(void) = (int32_t(*)(void))FBPtr; + int32_t(*FuncPtr)() = (int32_t(*)())FBPtr; EXPECT_EQ(initialNum, FuncPtr()) << "Invalid value for global returned from JITted function in module B"; uint64_t FAPtr = TheJIT->getFunctionAddress(FA->getName().str()); EXPECT_TRUE(0 != FAPtr); - FuncPtr = (int32_t(*)(void))FAPtr; + FuncPtr = (int32_t(*)())FAPtr; EXPECT_EQ(initialNum, FuncPtr()) << "Invalid value for global returned from JITted function in module A"; } diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index ff5b6e3decc..2e3d2b6665a 100644 --- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -78,7 +78,6 @@ private: class MCJITObjectCacheTest : public testing::Test, public MCJITTestBase { protected: - enum { OriginalRC = 6, ReplacementRC = 7 @@ -101,7 +100,7 @@ protected: EXPECT_TRUE(nullptr != vPtr) << "Unable to get pointer to main() from JIT"; - int (*FuncPtr)(void) = (int(*)(void))(intptr_t)vPtr; + int (*FuncPtr)() = (int(*)())(intptr_t)vPtr; int returnCode = FuncPtr(); EXPECT_EQ(returnCode, ExpectedRC); } @@ -119,7 +118,6 @@ TEST_F(MCJITObjectCacheTest, SetNullObjectCache) { compileAndRun(); } - TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) { SKIP_UNSUPPORTED_PLATFORM; @@ -228,5 +226,4 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) { EXPECT_FALSE(Cache->wereDuplicatesInserted()); } -} // Namespace - +} // end anonymous namespace diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp index 0f10441006a..744bfdb4a01 100644 --- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp +++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp @@ -89,7 +89,7 @@ TEST_F(MCJITTest, run_main) { EXPECT_TRUE(0 != ptr) << "Unable to get pointer to main() from JIT"; - int (*FuncPtr)(void) = (int(*)(void))ptr; + int (*FuncPtr)() = (int(*)())ptr; int returnCode = FuncPtr(); EXPECT_EQ(returnCode, rc); } @@ -109,7 +109,7 @@ TEST_F(MCJITTest, return_global) { uint64_t rgvPtr = TheJIT->getFunctionAddress(ReturnGlobal->getName().str()); EXPECT_TRUE(0 != rgvPtr); - int32_t(*FuncPtr)(void) = (int32_t(*)(void))rgvPtr; + int32_t(*FuncPtr)() = (int32_t(*)())rgvPtr; EXPECT_EQ(initialNum, FuncPtr()) << "Invalid value for global returned from JITted function"; } @@ -181,7 +181,7 @@ TEST_F(MCJITTest, multiple_functions) { EXPECT_TRUE(0 != ptr) << "Unable to get pointer to outer function from JIT"; - int32_t(*FuncPtr)(void) = (int32_t(*)(void))ptr; + int32_t(*FuncPtr)() = (int32_t(*)())ptr; EXPECT_EQ(innerRetVal, FuncPtr()) << "Incorrect result returned from function"; } diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp index 84b9d8d9407..07707c91cd9 100644 --- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp @@ -23,7 +23,6 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(TargetMachine, LLVMTargetMachineRef) class OrcCAPIExecutionTest : public testing::Test, public OrcExecutionTest { protected: - std::unique_ptr<Module> createTestModule(const Triple &TT) { ModuleBuilder MB(getGlobalContext(), TT.str(), ""); Function *TestFunc = MB.createFunctionDecl<int()>("testFunc"); @@ -37,9 +36,9 @@ protected: return MB.takeModule(); } - typedef int (*MainFnTy)(void); + typedef int (*MainFnTy)(); - static int myTestFuncImpl(void) { + static int myTestFuncImpl() { return 42; } @@ -66,16 +65,15 @@ protected: auto *ET = CCtx->APIExecTest; CCtx->M = ET->createTestModule(ET->TM->getTargetTriple()); CCtx->H = LLVMOrcAddEagerlyCompiledIR(JITStack, wrap(CCtx->M.get()), - myResolver, 0); + myResolver, nullptr); CCtx->Compiled = true; LLVMOrcTargetAddress MainAddr = LLVMOrcGetSymbolAddress(JITStack, "main"); LLVMOrcSetIndirectStubPointer(JITStack, "foo", MainAddr); return MainAddr; } - }; -char *OrcCAPIExecutionTest::testFuncName = 0; +char *OrcCAPIExecutionTest::testFuncName = nullptr; TEST_F(OrcCAPIExecutionTest, TestEagerIRCompilation) { if (!TM) @@ -89,7 +87,7 @@ TEST_F(OrcCAPIExecutionTest, TestEagerIRCompilation) { LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc"); LLVMOrcModuleHandle H = - LLVMOrcAddEagerlyCompiledIR(JIT, wrap(M.get()), myResolver, 0); + LLVMOrcAddEagerlyCompiledIR(JIT, wrap(M.get()), myResolver, nullptr); MainFnTy MainFn = (MainFnTy)LLVMOrcGetSymbolAddress(JIT, "main"); int Result = MainFn(); EXPECT_EQ(Result, 42) @@ -113,7 +111,7 @@ TEST_F(OrcCAPIExecutionTest, TestLazyIRCompilation) { LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc"); LLVMOrcModuleHandle H = - LLVMOrcAddLazilyCompiledIR(JIT, wrap(M.get()), myResolver, 0); + LLVMOrcAddLazilyCompiledIR(JIT, wrap(M.get()), myResolver, nullptr); MainFnTy MainFn = (MainFnTy)LLVMOrcGetSymbolAddress(JIT, "main"); int Result = MainFn(); EXPECT_EQ(Result, 42) @@ -158,4 +156,4 @@ TEST_F(OrcCAPIExecutionTest, TestDirectCallbacksAPI) { LLVMOrcDisposeInstance(JIT); } -} +} // namespace llvm |