diff options
author | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
commit | c6a4f5e819217e1e12c458aed8e7b122e23a3a58 (patch) | |
tree | 81b7dd2bb4370a392f31d332a566c903b5744764 /unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp | |
parent | 19c6fbb3e8aaf74093afa08013134b61fa08f245 (diff) | |
download | external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.zip external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.gz external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.bz2 |
Update LLVM for rebase to r212749.
Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls
Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
Diffstat (limited to 'unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp')
-rw-r--r-- | unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index 46847d3..fbbab42 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -48,7 +48,7 @@ public: const MemoryBuffer* BufferFound = getObjectInternal(M); ModulesLookedUp.insert(M->getModuleIdentifier()); if (!BufferFound) - return NULL; + return nullptr; // Our test cache wants to maintain ownership of its object buffers // so we make a copy here for the execution engine. return MemoryBuffer::getMemBufferCopy(BufferFound->getBuffer()); @@ -67,7 +67,7 @@ public: const std::string ModuleID = M->getModuleIdentifier(); StringMap<const MemoryBuffer *>::iterator it = ObjMap.find(ModuleID); if (it == ObjMap.end()) - return 0; + return nullptr; return it->second; } @@ -101,13 +101,13 @@ protected: void compileAndRun(int ExpectedRC = OriginalRC) { // This function shouldn't be called until after SetUp. ASSERT_TRUE(bool(TheJIT)); - ASSERT_TRUE(0 != Main); + ASSERT_TRUE(nullptr != Main); // We may be using a null cache, so ensure compilation is valid. TheJIT->finalizeObject(); void *vPtr = TheJIT->getPointerToFunction(Main); - EXPECT_TRUE(0 != vPtr) + EXPECT_TRUE(nullptr != vPtr) << "Unable to get pointer to main() from JIT"; int (*FuncPtr)(void) = (int(*)(void))(intptr_t)vPtr; @@ -123,7 +123,7 @@ TEST_F(MCJITObjectCacheTest, SetNullObjectCache) { createJIT(M.release()); - TheJIT->setObjectCache(NULL); + TheJIT->setObjectCache(nullptr); compileAndRun(); } @@ -143,7 +143,7 @@ TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) { // Verify that our object cache does not contain the module yet. const MemoryBuffer *ObjBuffer = Cache->getObjectInternal(SavedModulePointer); - EXPECT_EQ(0, ObjBuffer); + EXPECT_EQ(nullptr, ObjBuffer); compileAndRun(); @@ -152,7 +152,7 @@ TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) { // Verify that our object cache now contains the module. ObjBuffer = Cache->getObjectInternal(SavedModulePointer); - EXPECT_TRUE(0 != ObjBuffer); + EXPECT_TRUE(nullptr != ObjBuffer); // Verify that the cache was only notified once. EXPECT_FALSE(Cache->wereDuplicatesInserted()); @@ -221,7 +221,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) { // Verify that our object cache does not contain the module yet. const MemoryBuffer *ObjBuffer = Cache->getObjectInternal(SecondModulePointer); - EXPECT_EQ(0, ObjBuffer); + EXPECT_EQ(nullptr, ObjBuffer); // Run the function and look for the replacement return code. compileAndRun(ReplacementRC); @@ -231,7 +231,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) { // Verify that our object cache now contains the module. ObjBuffer = Cache->getObjectInternal(SecondModulePointer); - EXPECT_TRUE(0 != ObjBuffer); + EXPECT_TRUE(nullptr != ObjBuffer); // Verify that MCJIT didn't try to cache this again. EXPECT_FALSE(Cache->wereDuplicatesInserted()); |