From a16c51cee9225a354c999dd1076d5dba2aa79807 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Fri, 1 Jan 2010 10:31:22 +0000 Subject: Update LLVM to 92395. --- unittests/Support/LeakDetectorTest.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 unittests/Support/LeakDetectorTest.cpp (limited to 'unittests/Support/LeakDetectorTest.cpp') diff --git a/unittests/Support/LeakDetectorTest.cpp b/unittests/Support/LeakDetectorTest.cpp new file mode 100644 index 0000000..85ef046 --- /dev/null +++ b/unittests/Support/LeakDetectorTest.cpp @@ -0,0 +1,29 @@ +//===- llvm/unittest/LeakDetector/LeakDetector.cpp - LeakDetector tests ---===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" +#include "llvm/Support/LeakDetector.h" + +using namespace llvm; + +namespace { + +#ifdef GTEST_HAS_DEATH_TEST +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 + +} -- cgit v1.1