blob: 15c03b45e4c983167cc19675c957b04a98723306 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// Minimal test for LeakSanitizer+AddressSanitizer.
Stephen Hines86277eb2015-03-23 12:06:32 -07002// REQUIRES: leak-detection
Stephen Hines2d1fdb22014-05-28 23:58:16 -07003//
4// RUN: %clangxx_asan %s -o %t
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -07005// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_leaks=1 not %run %t 2>&1 | FileCheck %s
6// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS not %run %t 2>&1 | FileCheck %s
7// RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:detect_leaks=0 %run %t
Stephen Hines2d1fdb22014-05-28 23:58:16 -07008#include <stdio.h>
9int *t;
10
11int main(int argc, char **argv) {
12 t = new int[argc - 1];
13 printf("t: %p\n", t);
14 t = 0;
15}
16// CHECK: LeakSanitizer: detected memory leaks