]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/branchless-cond-add.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / branchless-cond-add.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 /* PR tree-optimization/110155 */
4
5 int f1(unsigned int x, unsigned int y, unsigned int z)
6 {
7 return ((x & 1) == 0) ? y : z + y;
8 }
9
10 int f2(unsigned int x, unsigned int y, unsigned int z)
11 {
12 return ((x & 1) != 0) ? z + y : y;
13 }
14
15 /* { dg-final { scan-tree-dump-times " \\\*" 2 "optimized" } } */
16 /* { dg-final { scan-tree-dump-times " \\\+ " 2 "optimized" } } */
17 /* { dg-final { scan-tree-dump-times " & " 2 "optimized" } } */
18 /* { dg-final { scan-tree-dump-not "if " "optimized" } } */