aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp15.c
blob: 7e7226487c2bd0535f09c6ac3ae7c0f3a80c8e5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */


extern void abort (void) __attribute__ ((__noreturn__));
union tree_node;
typedef union tree_node *tree;
enum tree_code
{
  ERROR_MARK,
  COND_EXPR = 42,
};
extern const unsigned char tree_code_length[];
struct tree_common
{
  enum tree_code code:8;
};
union tree_node
{
  struct tree_common common;
};
void
blah (tree t)
{
  if (t->common.code != COND_EXPR)
    abort ();
  if (1 >= tree_code_length[t->common.code])
    abort ();

}

/* { dg-final { scan-tree-dump-times "tree_code_length.42." 1 "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */