From 2c3e0051c31c3f5b2328b447eadf1cf9c4427442 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Wed, 6 May 2015 11:46:36 -0700 Subject: Update aosp/master LLVM for rebase to r235153 Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987) --- unittests/ExecutionEngine/ExecutionEngineTest.cpp | 3 ++- unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp | 28 +++++++++++----------- .../ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp | 4 ++-- unittests/ExecutionEngine/MCJIT/MCJITTest.cpp | 2 +- unittests/ExecutionEngine/MCJIT/MCJITTestBase.h | 5 ---- .../ExecutionEngine/Orc/LazyEmittingLayerTest.cpp | 10 ++++---- 6 files changed, 25 insertions(+), 27 deletions(-) (limited to 'unittests/ExecutionEngine') diff --git a/unittests/ExecutionEngine/ExecutionEngineTest.cpp b/unittests/ExecutionEngine/ExecutionEngineTest.cpp index 8ffc1c8..bb47c4c 100644 --- a/unittests/ExecutionEngine/ExecutionEngineTest.cpp +++ b/unittests/ExecutionEngine/ExecutionEngineTest.cpp @@ -33,7 +33,7 @@ protected: Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create()); } - virtual void SetUp() { + void SetUp() override { ASSERT_TRUE(Engine.get() != nullptr) << "EngineBuilder returned error: '" << Error << "'"; } @@ -54,6 +54,7 @@ TEST_F(ExecutionEngineTest, ForwardGlobalMapping) { int32_t Mem1 = 3; Engine->addGlobalMapping(G1, &Mem1); EXPECT_EQ(&Mem1, Engine->getPointerToGlobalIfAvailable(G1)); + EXPECT_EQ(&Mem1, Engine->getPointerToGlobalIfAvailable("Global1")); int32_t Mem2 = 4; Engine->updateGlobalMapping(G1, &Mem2); EXPECT_EQ(&Mem2, Engine->getPointerToGlobalIfAvailable(G1)); diff --git a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp index f2a3000..a7c9ae0 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp @@ -85,13 +85,11 @@ public: ReservedCodeSize(0), UsedCodeSize(0), ReservedDataSizeRO(0), UsedDataSizeRO(0), ReservedDataSizeRW(0), UsedDataSizeRW(0) { } - - virtual bool needsToReserveAllocationSpace() { - return true; - } - virtual void reserveAllocationSpace( - uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) { + bool needsToReserveAllocationSpace() override { return true; } + + void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO, + uintptr_t DataSizeRW) override { ReservedCodeSize = CodeSize; ReservedDataSizeRO = DataSizeRO; ReservedDataSizeRW = DataSizeRW; @@ -103,15 +101,17 @@ public: *UsedSize = AlignedBegin + AlignedSize; } - virtual uint8_t* allocateDataSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID, StringRef SectionName, bool IsReadOnly) { + uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID, StringRef SectionName, + bool IsReadOnly) override { useSpace(IsReadOnly ? &UsedDataSizeRO : &UsedDataSizeRW, Size, Alignment); return SectionMemoryManager::allocateDataSection(Size, Alignment, SectionID, SectionName, IsReadOnly); } - uint8_t* allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID, StringRef SectionName) { + uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, + unsigned SectionID, + StringRef SectionName) override { useSpace(&UsedCodeSize, Size, Alignment); return SectionMemoryManager::allocateCodeSection(Size, Alignment, SectionID, SectionName); @@ -141,8 +141,8 @@ protected: // that they will fail the MCJIT C API tests. UnsupportedEnvironments.push_back(Triple::Cygnus); } - - virtual void SetUp() { + + void SetUp() override { didCallAllocateCodeSection = false; didAllocateCompactUnwindSection = false; didCallYield = false; @@ -151,8 +151,8 @@ protected: Engine = nullptr; Error = nullptr; } - - virtual void TearDown() { + + void TearDown() override { if (Engine) LLVMDisposeExecutionEngine(Engine); else if (Module) diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index 2e38dd8..ff5b6e3 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -33,7 +33,7 @@ public: ObjMap[ModuleID] = copyBuffer(Obj); } - virtual std::unique_ptr getObject(const Module* M) override { + std::unique_ptr getObject(const Module *M) override { const MemoryBuffer* BufferFound = getObjectInternal(M); ModulesLookedUp.insert(M->getModuleIdentifier()); if (!BufferFound) @@ -84,7 +84,7 @@ protected: ReplacementRC = 7 }; - virtual void SetUp() { + void SetUp() override { M.reset(createEmptyModule("
")); Main = insertMainFunction(M.get(), OriginalRC); } diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp index 64d8c2f..94b9a69 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp @@ -22,7 +22,7 @@ namespace { class MCJITTest : public testing::Test, public MCJITTestBase { protected: - virtual void SetUp() { M.reset(createEmptyModule("
")); } + void SetUp() override { M.reset(createEmptyModule("
")); } }; // FIXME: Ensure creating an execution engine does not crash when constructed diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h index 35af417..901f142 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h +++ b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h @@ -308,11 +308,6 @@ protected: SupportedSubArchs.push_back("armv6"); SupportedSubArchs.push_back("armv7"); - // The operating systems below are known to be incompatible with MCJIT as - // they are copied from the test/ExecutionEngine/MCJIT/lit.local.cfg and - // should be kept in sync. - UnsupportedOSs.push_back(Triple::Darwin); - UnsupportedEnvironments.push_back(Triple::Cygnus); } diff --git a/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp b/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp index b0ff127..a495766 100644 --- a/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp @@ -14,9 +14,11 @@ namespace { struct MockBaseLayer { typedef int ModuleSetHandleT; - ModuleSetHandleT addModuleSet(std::list>, - std::unique_ptr x) { - EXPECT_FALSE(x); + ModuleSetHandleT addModuleSet( + std::list>, + std::unique_ptr MemMgr, + std::unique_ptr Resolver) { + EXPECT_FALSE(MemMgr); return 42; } }; @@ -24,7 +26,7 @@ struct MockBaseLayer { TEST(LazyEmittingLayerTest, Empty) { MockBaseLayer M; llvm::orc::LazyEmittingLayer L(M); - L.addModuleSet(std::list>(), nullptr); + L.addModuleSet(std::list>(), nullptr, nullptr); } } -- cgit v1.1