PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-12.c
blob42e3a2edb517b8cf6a64e636c87929e942dad35e
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 void link_error (void);
6 struct A
8 int a;
9 int b;
12 struct A a;
13 const int B = 42;
15 void foo (int i)
17 if (i > 10)
18 a.a = 42;
19 else
21 a.b = 21;
22 a.a = a.b + 21;
25 /* This should be folded to 'if (0)' as a.a and B are both 42. */
26 if (a.a != B)
27 link_error ();
30 int
31 main ()
33 foo (3);
34 return 0;