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

int
foo (int *p)
{
  return *p;
}

int
main (void)
{
  int **p = 0;
  return foo (*p);
}

/* { dg-output "load of null pointer of type 'int \\*'(\n|\r\n|\r)" } */