PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030729-1.c
blob59b48397c4bafc1eff3520dffd64245f0c086ef1
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom2" } */
4 extern void abort (void);
5 union tree_node;
6 typedef union tree_node *tree;
9 enum tree_code
11 SET_TYPE,
12 RECORD_TYPE,
13 LAST_AND_UNUSED_TREE_CODE
15 extern const char tree_code_type[];
17 struct tree_common
20 enum tree_code code:8;
27 union tree_node
29 struct tree_common common;
32 readonly_fields_p (type)
33 tree type;
36 if (type->common.code != RECORD_TYPE)
37 return;
39 if (tree_code_type[type->common.code] != 't')
40 abort ();
42 return;
45 /* A good optimizer would realize that the cast to (unsigned int) is
46 useless as the earlier cast of the same value of (unsigned char) will
47 always produce the same result. */
48 /* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom2"} } */
50 /* There should be one load of ->common.code. We currently fail this
51 because we load from ->common.code using different types. */
52 /* { dg-final { scan-tree-dump-times "common\.code" 1 "dom2"} } */
54 /* { dg-final { cleanup-tree-dump "dom2" } } */