PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030703-2.c
blob4a64b90db1a89b17335dfb9ab7cc5e4e8b87a8e8
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom2" } */
4 extern void abort (void);
6 union tree_node;
7 typedef union tree_node *tree;
8 extern const char tree_code_type[];
10 union tree_node
12 int code;
13 long pointer_alias_set;
16 long
17 get_alias_set (t)
18 tree t;
20 if (tree_code_type[t->code])
21 abort ();
22 if (t->pointer_alias_set)
24 tree __t = t;
25 if (tree_code_type[__t->code])
26 abort ();
30 /* There should be precisely one load of {t,__t}->code. If there is
31 more than one, then the dominator optimizations failed. */
32 /* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */
34 /* There should be precisely one load of tree_code_type. If there is
35 more than one, then the dominator optimizations failed. */
36 /* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom2"} } */
38 /* There should be one IF conditional. If 'tree_code_type[t->code]' is
39 zero, then the third if() conditional is unnecessary. That should cause
40 the call to abort() to be removed, which in turn causes the whole second
41 if() to disappear. */
42 /* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
44 /* { dg-final { cleanup-tree-dump "dom2" } } */