]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/branchless-cond.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / branchless-cond.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 int f1(unsigned int x, unsigned int y, unsigned int z)
5 {
6 return ((x & 1) == 0) ? y : z ^ y;
7 }
8
9 int f2(unsigned int x, unsigned int y, unsigned int z)
10 {
11 return ((x & 1) != 0) ? z ^ y : y;
12 }
13
14 int f3(unsigned int x, unsigned int y, unsigned int z)
15 {
16 return ((x & 1) == 0) ? y : z | y;
17 }
18
19 int f4(unsigned int x, unsigned int y, unsigned int z)
20 {
21 return ((x & 1) != 0) ? z | y : y;
22 }
23
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" } } */