summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/div-delay.c
blob: bdeb125d3f544cd8aded98ecc07f28e2d664ce89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-march=mips1 -fno-delayed-branch" } */
/* { dg-final { scan-assembler "\tbne\t.*\tnop" } } */

/* Ensure that mips1 does not put anything in the delay slot of the bne
   instruction when checking for divide by zero.  mips2+ systems use teq
   instead of bne and teq has no delay slot.  */

NOCOMPRESSION int
foo (int a, int b)
{
  return a / b;
}