libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / bitops-5.c
blob990610e300220114c68e391a6b28344ca0d01939
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized-raw" } */
3 /* PR tree-optimization/111679 */
5 int f1(int a, int b)
7 return (~a) | (a ^ b); // ~(a & b) or (~a) | (~b)
10 _Bool fb(_Bool c, _Bool d)
12 return (!c) | (c ^ d); // ~(c & d) or (~c) | (~d)
15 _Bool fb1(int x, int y)
17 _Bool a = x == 10, b = y > 100;
18 return (!a) | (a ^ b); // ~(a & b) or (~a) | (~b)
19 // or (x != 10) | (y <= 100)
22 /* { dg-final { scan-tree-dump-not "bit_xor_expr, " "optimized" } } */
23 /* { dg-final { scan-tree-dump-times "bit_not_expr, " 2 "optimized" } } */
24 /* { dg-final { scan-tree-dump-times "bit_and_expr, " 2 "optimized" } } */
25 /* { dg-final { scan-tree-dump-times "bit_ior_expr, " 1 "optimized" } } */
26 /* { dg-final { scan-tree-dump-times "ne_expr, _\[0-9\]+, x_\[0-9\]+" 1 "optimized" } } */
27 /* { dg-final { scan-tree-dump-times "le_expr, _\[0-9\]+, y_\[0-9\]+" 1 "optimized" } } */