aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/div-cmp-1.c
blob: cd1a5cd3d6fee5a10e9859ca99b344fa3fdb7f5f (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
/* { dg-do compile } */
/* { dg-options "-O2 -funsafe-math-optimizations -fdump-tree-optimized-raw" } */

int
cmp_mul_1 (float x)
{
  return x * 3 <= 100;
}

int
cmp_mul_2 (float x)
{
  return x * -5 > 100;
}

int
div_cmp_1 (float x, float y)
{
  return x / 3 <= y;
}

int
div_cmp_2 (float x, float y)
{
  return x / 3 <= 1;
}

/* { dg-final { scan-tree-dump-times "mult_expr" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-not "rdiv_expr" "optimized" } } */