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