mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			32 lines
		
	
	
		
			873 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			873 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| //===- 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
 | |
| 
 | |
| }
 |