PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-12.c
blob8ee9eb8d0e4b7c49e8cd820876869ac2e48ac86c
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 struct A
6 int a;
7 int b;
8 };
10 struct A a;
11 const int B = 42;
13 void foo (int i)
15 if (i > 10)
16 a.a = 42;
17 else
19 a.b = 21;
20 a.a = a.b + 21;
23 /* This should be folded to 'if (0)' as a.a and B are both 42. */
24 if (a.a != B)
25 link_error ();
28 main ()
30 foo (3);
31 return 0;