summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/c-c++-common/ubsan/null-9.c
blob: 7fabbeca4c7f0294e5c72fbe29a69db00d7b05f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do run } */
/* { dg-options "-fsanitize=null -w" } */
/* { dg-shouldfail "ubsan" } */
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */

union U {
  int i;
};

int
main (void)
{
  union U *u = 0;
  return u->i;
}

/* { dg-output "member access within null pointer of type 'union U'(\n|\r\n|\r)" } */
OpenPOWER on IntegriCloud