blob: 9515602ce89cbe51e0a472abb9c8e13e948c64ac [file] [log] [blame]
Stephen Hines6d186232014-11-26 17:56:19 -08001// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2// FIXME: merge this with the common null_deref test when we can run common
3// tests on Windows.
4
5__attribute__((noinline))
6static void NullDeref(int *ptr) {
7 // CHECK: ERROR: AddressSanitizer: access-violation on unknown address
8 // CHECK: {{0x0*000.. .*pc 0x.*}}
9 ptr[10]++; // BOOM
10}
11int main() {
12 NullDeref((int*)0);
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080013 // CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]]:3
Stephen Hines6d186232014-11-26 17:56:19 -080014 // CHECK: AddressSanitizer can not provide additional info.
15}