Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / pr28685-1.c
blob6b7b9175c79d99de2e103d12466e996585914404
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -fno-ipa-icf" } */
4 /* Should produce <=. */
5 int test1 (int a, int b)
7 return (a < b || a == b);
10 /* Should produce <=. */
11 int test2 (int a, int b)
13 int lt = a < b;
14 int eq = a == b;
16 return (lt || eq);
19 /* Should produce <= (just deleting redundant test). */
20 int test3 (int a, int b)
22 int lt = a <= b;
23 int eq = a == b;
25 return (lt || eq);
28 /* Should produce <= (operands reversed to test the swap logic). */
29 int test4 (int a, int b)
31 int lt = a < b;
32 int eq = b == a;
34 return (lt || eq);
37 /* Should produce constant 0. */
38 int test5 (int a, int b)
40 int lt = a < b;
41 int eq = a == b;
43 return (lt && eq);
46 /* { dg-final { scan-tree-dump-times " <= " 4 "optimized" } } */
47 /* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
48 /* { dg-final { scan-tree-dump-not " < " "optimized" } } */
49 /* { dg-final { scan-tree-dump-not " == " "optimized" } } */