1 //===- llvm/unittest/LeakDetector/LeakDetector.cpp - LeakDetector tests ---===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "gtest/gtest.h"
11 #include "llvm/Support/LeakDetector.h"
17 #ifdef GTEST_HAS_DEATH_TEST
19 TEST(LeakDetector
, Death1
) {
20 LeakDetector::addGarbageObject((void*) 1);
21 LeakDetector::addGarbageObject((void*) 2);
23 EXPECT_DEATH(LeakDetector::addGarbageObject((void*) 1),
24 ".*Ts.count\\(o\\) == 0 && \"Object already in set!\"");
25 EXPECT_DEATH(LeakDetector::addGarbageObject((void*) 2),
26 "Cache != o && \"Object already in set!\"");