summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/divmod-7.c
blob: 20a4cd30954537389695ef163fe557c14603a7d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2 -m8bit-idiv" } */
/* { dg-require-effective-target lp64 } */

extern void abort (void);

void
test (long long x, long long y, long long q, long long r)
{
  if ((x / y) != q || (x % y) != r)
    abort ();
}

/* { dg-final { scan-assembler-times "divb" 1 } } */
/* { dg-final { scan-assembler-times "idivq" 1 } } */