https://github.com/epiqc/ScaffCC
Raw File
Tip revision: 861c8b60980b0f4d36b101b45346a2e64b0fa390 authored by Pranav Gokhale on 05 February 2018, 05:29:11 UTC
update documentation and release notes
Tip revision: 861c8b6
LeakDetectorTest.cpp
//===- 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
#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

}
back to top