view gcc/testsuite/gcc.dg/div-cmp-1.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* { 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" } } */