diff options
Diffstat (limited to 'unittests/ExecutionEngine/JIT')
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp | 12 | ||||
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITTest.cpp | 16 | ||||
-rw-r--r-- | unittests/ExecutionEngine/JIT/MultiJITTest.cpp | 26 |
3 files changed, 27 insertions, 27 deletions
diff --git a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp index ab30884..296838d 100644 --- a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp @@ -267,12 +267,12 @@ TEST(JITMemoryManagerTest, TestManyStubs) { // After allocating a bunch of stubs, we should have two. for (int I = 0; I < Iters; ++I) - MemMgr->allocateStub(NULL, Size, 8); + MemMgr->allocateStub(nullptr, Size, 8); EXPECT_EQ(2U, MemMgr->GetNumStubSlabs()); // And after much more, we should have three. for (int I = 0; I < Iters; ++I) - MemMgr->allocateStub(NULL, Size, 8); + MemMgr->allocateStub(nullptr, Size, 8); EXPECT_EQ(3U, MemMgr->GetNumStubSlabs()); } @@ -286,10 +286,10 @@ TEST(JITMemoryManagerTest, AllocateSection) { uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, StringRef(), false); uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5, StringRef()); - EXPECT_NE((uint8_t*)0, code1); - EXPECT_NE((uint8_t*)0, code2); - EXPECT_NE((uint8_t*)0, data1); - EXPECT_NE((uint8_t*)0, data2); + EXPECT_NE((uint8_t*)nullptr, code1); + EXPECT_NE((uint8_t*)nullptr, code2); + EXPECT_NE((uint8_t*)nullptr, data1); + EXPECT_NE((uint8_t*)nullptr, data2); // Check alignment EXPECT_EQ((uint64_t)code1 & 0xf, 0u); diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index f438286..817d207 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -169,7 +169,7 @@ public: bool LoadAssemblyInto(Module *M, const char *assembly) { SMDiagnostic Error; bool success = - NULL != ParseAssemblyString(assembly, M, Error, M->getContext()); + nullptr != ParseAssemblyString(assembly, M, Error, M->getContext()); std::string errMsg; raw_string_ostream os(errMsg); Error.print("", os); @@ -193,7 +193,7 @@ class JITTest : public testing::Test { .setJITMemoryManager(RJMM) .setErrorStr(&Error) .setTargetOptions(Options).create()); - ASSERT_TRUE(TheJIT.get() != NULL) << Error; + ASSERT_TRUE(TheJIT.get() != nullptr) << Error; } void LoadAssembly(const char *assembly) { @@ -249,7 +249,7 @@ TEST(JIT, GlobalInFunction) { // Since F1 was codegen'd, a pointer to G should be available. int32_t *GPtr = (int32_t*)JIT->getPointerToGlobalIfAvailable(G); - ASSERT_NE((int32_t*)NULL, GPtr); + ASSERT_NE((int32_t*)nullptr, GPtr); EXPECT_EQ(0, *GPtr); // F1() should increment G. @@ -633,10 +633,10 @@ ExecutionEngine *getJITFromBitcode( MemoryBuffer *BitcodeBuffer = MemoryBuffer::getMemBuffer(Bitcode, "Bitcode for test"); ErrorOr<Module*> ModuleOrErr = getLazyBitcodeModule(BitcodeBuffer, Context); - if (error_code EC = ModuleOrErr.getError()) { + if (std::error_code EC = ModuleOrErr.getError()) { ADD_FAILURE() << EC.message(); delete BitcodeBuffer; - return NULL; + return nullptr; } M = ModuleOrErr.get(); std::string errMsg; @@ -644,11 +644,11 @@ ExecutionEngine *getJITFromBitcode( .setEngineKind(EngineKind::JIT) .setErrorStr(&errMsg) .create(); - if (TheJIT == NULL) { + if (TheJIT == nullptr) { ADD_FAILURE() << errMsg; delete M; - M = NULL; - return NULL; + M = nullptr; + return nullptr; } return TheJIT; } diff --git a/unittests/ExecutionEngine/JIT/MultiJITTest.cpp b/unittests/ExecutionEngine/JIT/MultiJITTest.cpp index 5016532..f530e0d 100644 --- a/unittests/ExecutionEngine/JIT/MultiJITTest.cpp +++ b/unittests/ExecutionEngine/JIT/MultiJITTest.cpp @@ -27,7 +27,7 @@ namespace { bool LoadAssemblyInto(Module *M, const char *assembly) { SMDiagnostic Error; bool success = - NULL != ParseAssemblyString(assembly, M, Error, M->getContext()); + nullptr != ParseAssemblyString(assembly, M, Error, M->getContext()); std::string errMsg; raw_string_ostream os(errMsg); Error.print("", os); @@ -71,13 +71,13 @@ void createModule2(LLVMContext &Context2, Module *&M2, Function *&FooF2) { TEST(MultiJitTest, EagerMode) { LLVMContext Context1; - Module *M1 = 0; - Function *FooF1 = 0; + Module *M1 = nullptr; + Function *FooF1 = nullptr; createModule1(Context1, M1, FooF1); LLVMContext Context2; - Module *M2 = 0; - Function *FooF2 = 0; + Module *M2 = nullptr; + Function *FooF2 = nullptr; createModule2(Context2, M2, FooF2); // Now we create the JIT in eager mode @@ -101,13 +101,13 @@ TEST(MultiJitTest, EagerMode) { TEST(MultiJitTest, LazyMode) { LLVMContext Context1; - Module *M1 = 0; - Function *FooF1 = 0; + Module *M1 = nullptr; + Function *FooF1 = nullptr; createModule1(Context1, M1, FooF1); LLVMContext Context2; - Module *M2 = 0; - Function *FooF2 = 0; + Module *M2 = nullptr; + Function *FooF2 = nullptr; createModule2(Context2, M2, FooF2); // Now we create the JIT in lazy mode @@ -135,13 +135,13 @@ extern "C" { TEST(MultiJitTest, JitPool) { LLVMContext Context1; - Module *M1 = 0; - Function *FooF1 = 0; + Module *M1 = nullptr; + Function *FooF1 = nullptr; createModule1(Context1, M1, FooF1); LLVMContext Context2; - Module *M2 = 0; - Function *FooF2 = 0; + Module *M2 = nullptr; + Function *FooF2 = nullptr; createModule2(Context2, M2, FooF2); // Now we create two JITs |