annotate gcc/testsuite/gcc.dg/pr28685-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fdump-tree-optimized -fno-ipa-icf" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Should produce <=. */
kono
parents:
diff changeset
5 int test1 (int a, int b)
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 return (a < b || a == b);
kono
parents:
diff changeset
8 }
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 /* Should produce <=. */
kono
parents:
diff changeset
11 int test2 (int a, int b)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 int lt = a < b;
kono
parents:
diff changeset
14 int eq = a == b;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 return (lt || eq);
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 /* Should produce <= (just deleting redundant test). */
kono
parents:
diff changeset
20 int test3 (int a, int b)
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 int lt = a <= b;
kono
parents:
diff changeset
23 int eq = a == b;
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 return (lt || eq);
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* Should produce <= (operands reversed to test the swap logic). */
kono
parents:
diff changeset
29 int test4 (int a, int b)
kono
parents:
diff changeset
30 {
kono
parents:
diff changeset
31 int lt = a < b;
kono
parents:
diff changeset
32 int eq = b == a;
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 return (lt || eq);
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* Should produce constant 0. */
kono
parents:
diff changeset
38 int test5 (int a, int b)
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 int lt = a < b;
kono
parents:
diff changeset
41 int eq = a == b;
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 return (lt && eq);
kono
parents:
diff changeset
44 }
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* { dg-final { scan-tree-dump-times " <= " 4 "optimized" } } */
kono
parents:
diff changeset
47 /* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
kono
parents:
diff changeset
48 /* { dg-final { scan-tree-dump-not " < " "optimized" } } */
kono
parents:
diff changeset
49 /* { dg-final { scan-tree-dump-not " == " "optimized" } } */