re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp15.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1" } */
3
4
5 extern void abort (void) __attribute__ ((__noreturn__));
6 union tree_node;
7 typedef union tree_node *tree;
8 enum tree_code
9 {
10 ERROR_MARK,
11 COND_EXPR = 42,
12 };
13 extern const unsigned char tree_code_length[];
14 struct tree_common
15 {
16 enum tree_code code:8;
17 };
18 union tree_node
19 {
20 struct tree_common common;
21 };
22 void
23 blah (tree t)
24 {
25 if (t->common.code != COND_EXPR)
26 abort ();
27 if (1 >= tree_code_length[t->common.code])
28 abort ();
29
30 }
31
32 /* { dg-final { scan-tree-dump-times "tree_code_length.42." 1 "vrp1" } } */
33 /* { dg-final { cleanup-tree-dump "vrp1" } } */
34