2013-11-14 16:56:59 +08:00
|
|
|
// RUN: %clangxx_asan -O0 %s -o %t
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=YES
|
2014-05-26 21:44:57 +08:00
|
|
|
// RUN: env ASAN_OPTIONS=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=NO
|
2013-11-14 16:56:59 +08:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
char *x = new char[20];
|
|
|
|
delete[] x;
|
|
|
|
return x[0];
|
|
|
|
// YES: ERROR: AddressSanitizer: heap-use-after-free
|
|
|
|
// YES: SUMMARY: AddressSanitizer: heap-use-after-free
|
|
|
|
// NO: ERROR: AddressSanitizer: heap-use-after-free
|
|
|
|
// NO-NOT: SUMMARY: AddressSanitizer: heap-use-after-free
|
|
|
|
}
|
|
|
|
|