Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/gcc/testsuite/g++.dg/pr105276.C

19 lines
365 B
C

/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
bool
foo(unsigned i)
{
bool result = true;
while (i)
{
i = i % 3;
i = i - (i == 2 ? 2 : i ? 1 : 0);
result = !result;
}
return result;
}
/* We should be able to eliminate the i - operation. */
/* { dg-final { scan-tree-dump-not "i_.* - " "optimized" } } */