summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/simplCore/should_compile/Makefile10
-rw-r--r--testsuite/tests/simplCore/should_compile/T5615.hs10
-rw-r--r--testsuite/tests/simplCore/should_compile/T5615.stdout1
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T1
4 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index 8b7da66e27..288e3f96e5 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -144,3 +144,13 @@ T10083:
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
+
+.PHONY: T5615
+T5615:
+ $(RM) -f T5615.o T5615.hi T5615.dump-simpl
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5615.hs -ddump-simpl -ddump-to-file
+ -grep 'divInt#' T5615.dump-simpl
+ -grep 'modInt#' T5615.dump-simpl
+ -grep 'quotInt#' T5615.dump-simpl
+ -grep 'remInt#' T5615.dump-simpl
+ grep -c '1999#' T5615.dump-simpl
diff --git a/testsuite/tests/simplCore/should_compile/T5615.hs b/testsuite/tests/simplCore/should_compile/T5615.hs
new file mode 100644
index 0000000000..984480431b
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T5615.hs
@@ -0,0 +1,10 @@
+main :: IO ()
+main = do
+ printInt $ 9999 `div` 5
+ printInt $ 9999 `mod` 5
+ n <- readLn
+ printInt $ n `div` 4
+ printInt $ n `mod` 4
+
+printInt :: Int -> IO ()
+printInt = print
diff --git a/testsuite/tests/simplCore/should_compile/T5615.stdout b/testsuite/tests/simplCore/should_compile/T5615.stdout
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T5615.stdout
@@ -0,0 +1 @@
+1
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index e2e0bb6c31..f985b4a859 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -137,6 +137,7 @@ test('simpl021',
run_command,
['$MAKE -s --no-print-directory simpl021'])
test('T5327', normal, run_command, ['$MAKE -s --no-print-directory T5327'])
+test('T5615', normal, run_command, ['$MAKE -s --no-print-directory T5615'])
test('T5623', normal, run_command, ['$MAKE -s --no-print-directory T5623'])
test('T5658b',
normal,