libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / bitops-6.c
blobe6ab2fd6c71bf8ff4140c3a9971d244e1f174d62
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized-raw" } */
3 /* PR tree-optimization/111282 */
6 int f(int a, int b)
8 return a & (b ^ ~a); // a & b
11 _Bool fb(_Bool x, _Bool y)
13 return x & (y ^ !x); // x & y
16 int fa(int w, int z)
18 return (~w) & (w ^ z); // ~w & z
21 int fcmp(int x, int y)
23 _Bool a = x == 2;
24 _Bool b = y == 1;
25 return a & (b ^ !a); // (x == 2) & (y == 1)
28 /* { dg-final { scan-tree-dump-not "bit_xor_expr, " "optimized" } } */
29 /* { dg-final { scan-tree-dump-times "bit_and_expr, " 4 "optimized" } } */
30 /* { dg-final { scan-tree-dump-times "bit_not_expr, " 1 "optimized" } } */
31 /* { dg-final { scan-tree-dump-not "ne_expr, " "optimized" } } */
32 /* { dg-final { scan-tree-dump-times "eq_expr, " 2 "optimized" } } */