OSDN Git Service

Add -m8bit-idiv for x86.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / divmod-6.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -m8bit-idiv" } */
3
4 extern void abort (void);
5
6 void
7 __attribute__((noinline))
8 test (long long x, long long y, long long q, long long r)
9 {
10   if ((x / y) != q || (x % y) != r)
11     abort ();
12 }
13
14 int
15 main ()
16 {
17   test (7, 6, 1, 1);
18   test (-7, -6, 1, -1);
19   test (-7, 6, -1, -1);
20   test (7, -6, -1, 1);
21   test (255, 254, 1, 1);
22   test (256, 254, 1, 2);
23   test (256, 256, 1, 0);
24   test (254, 256, 0, 254);
25   test (254, 255, 0, 254);
26   test (254, 1, 254, 0);
27   test (255, 2, 127, 1);
28   test (1, 256, 0, 1);
29   return 0;
30 }