libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / cmpbit-7.c
blobee04ebbaaed80c11f0661dca9146cdee5d3ef7d9
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-forwprop1" } */
3 /* PR tree-optimization/106164 */
4 /* PR tree-optimization/111456 */
6 _Bool f(int a)
8 _Bool t = a == 3;
9 unsigned t1 = a;
10 _Bool t2 = t1 >= 3;
11 return t | t2;
14 /* Should be able to optimize down to just `a > 2` during forwprop1 */
15 /* { dg-final { scan-tree-dump-not "a_\[0-9\]+.D. == 3" "forwprop1" } } */
17 _Bool f1(int b)
19 _Bool t = b == 3;
20 short t1 = b;
21 _Bool t2 = t1 >= 3;
22 return t | t2;
25 /* Should be able to optimize down to just `a > 2` during forwprop1 as `((short)a) >= 3` is
26 true already when `a == 3`. */
27 /* { dg-final { scan-tree-dump-not "b_\[0-9\]+.D. == 3" "forwprop1" } } */
28 /* { dg-final { scan-tree-dump-times "_\[0-9\]+ > 2" 2 "forwprop1" } } */