OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030711-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom3" } */
3  
4 extern void abort (void);
5
6 union tree_node;
7 typedef union tree_node *tree;
8 struct tree_vec
9 {
10           int length;
11             tree a[1];
12 };
13 struct tree_type
14 {
15           tree binfo;
16 };
17 union tree_node
18 {
19           struct tree_type type;
20             struct tree_vec vec;
21 };
22
23 void
24 record_component_aliases (type)
25      tree type;
26 {
27   int i;
28   if (4 >= type->type.binfo->vec.length)
29     abort ();
30   for (; i < ((
31                 {
32                 const tree __t = type->type.binfo;
33                 if (4 >= __t->vec.length)
34                 abort (); type->type.binfo->vec.a[4];}
35               )->vec.length);)
36     {
37       if (4 >= type->type.binfo->vec.length)
38         abort ();
39       blah ();
40     }
41 }
42
43 /* The call to blah can not be eliminated.  */
44 /* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom3" } } */
45    
46 /* There should be four IF conditionals.  */
47 /* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
48                                                                                 
49 /* There should be two loads of type.binfo.  */
50 /* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom3"} } */
51  
52 /* There should be four loads of vec.length.  */
53 /* { dg-final { scan-tree-dump-times "vec.length" 3 "dom3"} } */
54
55 /* { dg-final { cleanup-tree-dump "dom3" } } */