//
//===----------------------------------------------------------------------===//
-#include "llvm/ADT/OwningPtr.h"
#include "MCJITTestBase.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
void compileAndRun(int ExpectedRC = OriginalRC) {
// This function shouldn't be called until after SetUp.
- ASSERT_TRUE(TheJIT.isValid());
+ ASSERT_TRUE(bool(TheJIT));
ASSERT_TRUE(0 != Main);
// We may be using a null cache, so ensure compilation is valid.
TEST_F(MCJITObjectCacheTest, SetNullObjectCache) {
SKIP_UNSUPPORTED_PLATFORM;
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(NULL);
TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) {
SKIP_UNSUPPORTED_PLATFORM;
- OwningPtr<TestObjectCache> Cache(new TestObjectCache);
+ std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
// Save a copy of the module pointer before handing it off to MCJIT.
const Module * SavedModulePointer = M.get();
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) {
SKIP_UNSUPPORTED_PLATFORM;
- OwningPtr<TestObjectCache> Cache(new TestObjectCache);
+ std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
// Compile this module with an MCJIT engine
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
TheJIT->finalizeObject();
const Module * SecondModulePointer = M.get();
// Create a new MCJIT instance to load this module then execute it.
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
compileAndRun();
TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) {
SKIP_UNSUPPORTED_PLATFORM;
- OwningPtr<TestObjectCache> Cache(new TestObjectCache);
+ std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
// Compile this module with an MCJIT engine
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
TheJIT->finalizeObject();
const Module * SecondModulePointer = M.get();
// Create a new MCJIT instance to load this module then execute it.
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
// Verify that our object cache does not contain the module yet.