blob: e063dc4bb5fb4145c60494d2be58f2177bdb2809 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
int f1(unsigned int x, unsigned int y, unsigned int z)
{
return ((x & 1) == 0) ? y : z ^ y;
}
int f2(unsigned int x, unsigned int y, unsigned int z)
{
return ((x & 1) != 0) ? z ^ y : y;
}
int f3(unsigned int x, unsigned int y, unsigned int z)
{
return ((x & 1) == 0) ? y : z | y;
}
int f4(unsigned int x, unsigned int y, unsigned int z)
{
return ((x & 1) != 0) ? z | y : y;
}
/* { dg-final { scan-tree-dump-times " \\\*" 4 "optimized" } } */
/* { dg-final { scan-tree-dump-times " & " 4 "optimized" } } */
/* { dg-final { scan-tree-dump-not "if " "optimized" } } */
|