blob: 24aea1a2d03c64cb81e8a95137e2ea5096f53863 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized-raw" } */
_Bool eqeq0(unsigned x)
{
return x == (x == 0);
}
_Bool eqeq1(unsigned x)
{
return x == (x == 1);
}
_Bool eqeq2(unsigned x)
{
return x == (x == 2);
}
_Bool neeq0(unsigned x)
{
return x != (x == 0);
}
_Bool neeq1(unsigned x)
{
return x != (x == 1);
}
_Bool neeq2(unsigned x)
{
return x != (x == 2);
}
_Bool eqne0(unsigned x)
{
return x == (x != 0);
}
_Bool eqne1(unsigned x)
{
return x == (x != 1);
}
_Bool eqne2(unsigned x)
{
return x == (x != 2);
}
_Bool nene0(unsigned x)
{
return x != (x != 0);
}
_Bool nene1(unsigned x)
{
return x != (x != 1);
}
_Bool nene2(unsigned x)
{
return x != (x != 2);
}
/* All of these functions should have removed the inner most comparison which
means all of the conversions from bool to unsigned should have been removed too. */
/* { dg-final { scan-tree-dump-not "nop_expr," "optimized"} } */
|