7fabbeca4c7f0294e5c72fbe29a69db00d7b05f7
[gcc.git] / gcc / testsuite / c-c++-common / ubsan / null-9.c
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=null -w" } */
3 /* { dg-shouldfail "ubsan" } */
4 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
5
6 union U {
7 int i;
8 };
9
10 int
11 main (void)
12 {
13 union U *u = 0;
14 return u->i;
15 }
16
17 /* { dg-output "member access within null pointer of type 'union U'(\n|\r\n|\r)" } */