summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/divmod-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/divmod-7.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/divmod-7.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/divmod-7.c b/gcc/testsuite/gcc.target/i386/divmod-7.c
new file mode 100644
index 000000000..20a4cd309
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/divmod-7.c
@@ -0,0 +1,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 } } */