annotate gcc/testsuite/gcc.dg/tree-ssa/isolate-4.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fdelete-null-pointer-checks -fisolate-erroneous-paths-attribute -fdump-tree-isolate-paths -fdump-tree-phicprop1" } */
kono
parents:
diff changeset
3 /* { dg-skip-if "" keeps_null_pointer_checks } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 extern void foo(void *) __attribute__ ((__nonnull__ (1)));
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 int z;
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 void
kono
parents:
diff changeset
11 com (int a)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 foo (a == 42 ? &z : (void *) 0);
kono
parents:
diff changeset
14 }
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 void
kono
parents:
diff changeset
17 bar (void)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 foo ((void *)0);
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 /* We testing that the path isolation code can take advantage of the
kono
parents:
diff changeset
23 returns non-null attribute to isolate a path where NULL flows into
kono
parents:
diff changeset
24 a return statement.
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 We also verify that after isolation phi-cprop simplifies the
kono
parents:
diff changeset
27 return statement so that it returns &z directly. */
kono
parents:
diff changeset
28 /* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "isolate-paths"} } */
kono
parents:
diff changeset
29 /* { dg-final { scan-tree-dump-times "foo .&z.;" 1 "phicprop1"} } */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31