libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr105832-3.c
blob2bdd9afcbc79ff707c5db10057a978df586300e7
1 /* PR tree-optimization/105832 */
2 /* { dg-do compile } */
3 /* Disable the first forwprop1 as that will catch f2/f4 even though `&1`
4 will be removed during evrp. */
5 /* { dg-options "-O2 -fdisable-tree-forwprop1 -fdump-tree-optimized" } */
6 /* { dg-final { scan-tree-dump "a_\[0-9]+\\(D\\) == 0" "optimized" } } */
7 /* { dg-final { scan-tree-dump "b_\[0-9]+\\(D\\) == 0" "optimized" } } */
8 /* { dg-final { scan-tree-dump "c_\[0-9]+\\(D\\) != 0" "optimized" } } */
9 /* { dg-final { scan-tree-dump "d_\[0-9]+\\(D\\) != 0" "optimized" } } */
11 int g(void);
12 int h(void);
14 int
15 f1 (int a)
17 int t = 1 >> a;
18 if (t != 0) return g();
19 return h();
22 int
23 f2 (int b)
25 int t = 1 >> b;
26 t &= 1;
27 if (t != 0) return g();
28 return h();
31 int
32 f3 (int c)
34 int t = 1 >> c;
35 if (t == 0) return g();
36 return h();
39 int
40 f4 (int d)
42 int t = 1 >> d;
43 t &= 1;
44 if (t == 0) return g();
45 return h();