OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [udivmod-6.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -m8bit-idiv" } */
3
 
4
extern void abort (void);
5
 
6
void
7
__attribute__((noinline))
8
test (unsigned long long x, unsigned long long y,
9
      unsigned long long q, unsigned long long r)
10
{
11
  if ((x / y) != q || (x % y) != r)
12
    abort ();
13
}
14
 
15
int
16
main ()
17
{
18
  test (7, 6, 1, 1);
19
  test (255, 254, 1, 1);
20
  test (256, 254, 1, 2);
21
  test (256, 256, 1, 0);
22
  test (254, 256, 0, 254);
23
  test (254, 255, 0, 254);
24
  test (254, 1, 254, 0);
25
  test (255, 2, 127, 1);
26
  test (1, 256, 0, 1);
27
  test (0x80000000, 0x7fffffff, 1, 1);
28
  test (0x7fffffff, 0x80000000, 0, 0x7fffffff);
29
  test (0x80000000, 0x80000003, 0, 0x80000000);
30
  test (0xfffffffd, 0xfffffffe, 0, 0xfffffffd);
31
  return 0;
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.