blob: 42172109d255cf34ddbbbace36de0f34aabab4aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
// FIXME: merge this with the common null_deref test when we can run common
// tests on Windows.
__attribute__((noinline))
static void NullDeref(int *ptr) {
// CHECK: ERROR: AddressSanitizer: access-violation on unknown address
// CHECK: {{0x0*000.. .*pc 0x.*}}
ptr[10]++; // BOOM
}
int main() {
NullDeref((int*)0);
// CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]]
// CHECK: {{AddressSanitizer can not provide additional info.}}
}
|