mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-05 18:27:59 +00:00
c597073453
source file had already been moved. Also move the unittest into the IR unittest library. This may seem an odd thing to put in the IR library but we only really use this with instructions and it needs the LLVM context to work, so it is intrinsically tied to the IR library. llvm-svn: 202842
32 lines
868 B
C++
32 lines
868 B
C++
//===- LeakDetectorTest.cpp -----------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/IR/LeakDetector.h"
|
|
#include "gtest/gtest.h"
|
|
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
|
|
#ifdef GTEST_HAS_DEATH_TEST
|
|
#ifndef NDEBUG
|
|
TEST(LeakDetector, Death1) {
|
|
LeakDetector::addGarbageObject((void*) 1);
|
|
LeakDetector::addGarbageObject((void*) 2);
|
|
|
|
EXPECT_DEATH(LeakDetector::addGarbageObject((void*) 1),
|
|
".*Ts.count\\(o\\) == 0 && \"Object already in set!\"");
|
|
EXPECT_DEATH(LeakDetector::addGarbageObject((void*) 2),
|
|
"Cache != o && \"Object already in set!\"");
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
}
|