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

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)" } */