* c-c++-common/ubsan/align-7.c: Skip for -flto -fno-fat-lto-objects.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / null-5.C
blobfbda96ff471fd12c04cfb39c893e72b3a0ee6dea
1 // { dg-do run }
2 // { dg-options "-O -fsanitize=null -fsanitize-undefined-trap-on-error -fdump-tree-sanopt-details" }
3 // { dg-skip-if "" { *-*-* } { "-flto -fno-fat-lto-objects" } }
4 // { dg-shouldfail "ubsan" }
6 int
7 main (void)
9   int *p = 0;
11   int &r1 = *p;
12   int &r2 = *p;
13   int &r3 = *p;
14   int &r4 = *p;
15   int &r5 = *p;
18 // { dg-final { scan-tree-dump-times "Optimizing" 4 "sanopt"} }
19 // { dg-final { cleanup-tree-dump "sanopt" } }