MATCH: Allow unsigned types for `X & -Y -> X * Y` pattern
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / branchless-cond.c
blobe063dc4bb5fb4145c60494d2be58f2177bdb2809
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int f1(unsigned int x, unsigned int y, unsigned int z)
6 return ((x & 1) == 0) ? y : z ^ y;
9 int f2(unsigned int x, unsigned int y, unsigned int z)
11 return ((x & 1) != 0) ? z ^ y : y;
14 int f3(unsigned int x, unsigned int y, unsigned int z)
16 return ((x & 1) == 0) ? y : z | y;
19 int f4(unsigned int x, unsigned int y, unsigned int z)
21 return ((x & 1) != 0) ? z | y : y;
24 /* { dg-final { scan-tree-dump-times " \\\*" 4 "optimized" } } */
25 /* { dg-final { scan-tree-dump-times " & " 4 "optimized" } } */
26 /* { dg-final { scan-tree-dump-not "if " "optimized" } } */