PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / isolate-4.c
blob0a88d7d47f6e91d82f167c2ab0e926c58c1ef0de
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdelete-null-pointer-checks -fisolate-erroneous-paths-attribute -fdump-tree-isolate-paths -fdump-tree-phicprop1" } */
3 /* { dg-skip-if "" keeps_null_pointer_checks } */
6 extern void foo(void *) __attribute__ ((__nonnull__ (1)));
8 int z;
10 void
11 com (int a)
13 foo (a == 42 ? &z : (void *) 0);
16 void
17 bar (void)
19 foo ((void *)0);
22 /* We testing that the path isolation code can take advantage of the
23 returns non-null attribute to isolate a path where NULL flows into
24 a return statement.
26 We also verify that after isolation phi-cprop simplifies the
27 return statement so that it returns &z directly. */
28 /* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "isolate-paths"} } */
29 /* { dg-final { scan-tree-dump-times "foo .&z.;" 1 "phicprop1"} } */