Disable gnat.dg/socket1.adb on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / sanitize-all-2.c
blob4c631af3257d70fa3711773e37bffe34f78b2311
1 /* Test -f*sanitize*=all */
2 /* { dg-do run } */
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
4 /* { dg-skip-if "" { *-*-* } { "-flto -fno-fat-lto-objects" } } */
5 /* { dg-options "-fsanitize=undefined,float-cast-overflow,float-divide-by-zero -fno-sanitize=all -fdump-tree-optimized" } */
7 int a[4];
9 int
10 f1 (int x, int y, int z)
12 return a[x] + (1 << y) + (100 / z);
15 char *
16 f2 (int x)
18 char *p = (char *) __builtin_calloc (64, 1);
19 p[x] = 3;
20 return p;
23 int
24 f3 (int x, int *y, double z, double w)
26 int a[*y];
27 if (x)
28 __builtin_unreachable ();
29 asm volatile ("" : : "r" (&a[0]));
30 return z / w;
33 int
34 main ()
36 return 0;
39 /* { dg-final { scan-tree-dump-not "__ubsan_" "optimized" } } */
40 /* { dg-final { scan-tree-dump-not "UBSAN_CHECK_" "optimized" } } */