Files
clang-p2996/compiler-rt/test/asan/TestCases/Linux/leak.cc
Alexey Samsonov 1130681716 [ASan] More ASAN_OPTIONS churn: use %env_asan_opts where applicable.
Reviewers: filcab, rnk, kubabrecka

Subscribers: tberghammer, danalbert, srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D12305

llvm-svn: 245962
2015-08-25 18:27:53 +00:00

17 lines
446 B
C++

// Minimal test for LeakSanitizer+AddressSanitizer.
// REQUIRES: leak-detection
//
// RUN: %clangxx_asan %s -o %t
// RUN: %env_asan_opts=detect_leaks=1 not %run %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=detect_leaks=0 %run %t
#include <stdio.h>
int *t;
int main(int argc, char **argv) {
t = new int[argc - 1];
printf("t: %p\n", t);
t = 0;
}
// CHECK: LeakSanitizer: detected memory leaks