blob: 949c9b54f8a35ec381f7a2727cfb583137bdad60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %t 2>&1 | FileCheck %s --check-prefix=YES
// RUN: ASAN_OPTIONS=print_summary=false not %t 2>&1 | FileCheck %s --check-prefix=NO
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
}
|