1 /* { dg-do compile } */
2 /* { dg-options "-O2 -funsafe-math-optimizations -fdump-tree-optimized-raw" } */
3
4 int
cmp_mul_1(float x)5 cmp_mul_1 (float x)
6 {
7 return x * 3 <= 100;
8 }
9
10 int
cmp_mul_2(float x)11 cmp_mul_2 (float x)
12 {
13 return x * -5 > 100;
14 }
15
16 int
div_cmp_1(float x,float y)17 div_cmp_1 (float x, float y)
18 {
19 return x / 3 <= y;
20 }
21
22 int
div_cmp_2(float x,float y)23 div_cmp_2 (float x, float y)
24 {
25 return x / 3 <= 1;
26 }
27
28 /* { dg-final { scan-tree-dump-times "mult_expr" 1 "optimized" } } */
29 /* { dg-final { scan-tree-dump-not "rdiv_expr" "optimized" } } */
30