2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030710-1.c
blob3dd3ba8bc17aad01eeacd6c9a21d9bf07ebce6fb
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-phicprop1" } */
4 extern void abort (void);
5 extern void blah (void);
6 union tree_node;
7 typedef union tree_node *tree;
8 struct tree_vec
10 int length;
11 tree a[1];
13 struct tree_type
15 tree binfo;
17 union tree_node
19 struct tree_type type;
20 struct tree_vec vec;
22 void
23 record_component_aliases (type)
24 tree type;
26 if (type->type.binfo->vec.length)
27 abort ();
28 for (; ((
30 const tree __z = type->type.binfo;
31 if (type->type.binfo->vec.length)
32 abort ();
33 type->type.binfo->vec.a[4];}
34 )->vec.length);)
36 if (4 >= type->type.binfo->vec.length)
37 abort ();
38 blah ();
42 /* The call to blah should have been eliminated. If the call is not
43 eliminated, then dominator optimizations failed and it'll be
44 impossible to delete other unnecessary code. */
45 /* { dg-final { scan-tree-dump-not "blah \\(\\)" "phicprop1" } } */
47 /* There should be two IF conditionals. */
48 /* { dg-final { scan-tree-dump-times "if " 2 "phicprop1"} } */
50 /* There should be a single load of type.binfo. */
51 /* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "phicprop1"} } */
53 /* There should be two loads of vec.length. */
54 /* { dg-final { scan-tree-dump-times "vec.length" 2 "phicprop1"} } */