summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-03-07 15:38:55 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-18 05:11:35 -0400
commit435a3d5df098099ec984847b84f0bc734f5d2c3f (patch)
tree54f873643a2ea0769ba002922987c7cf31d2ded4
parentd147428a5041adcdda2ffe02e3012c7987be3c23 (diff)
downloadhaskell-wip/T19503.tar.gz
testsuite: Add test for #21186wip/T19503
-rw-r--r--testsuite/tests/codeGen/should_run/T21186.hs13
-rw-r--r--testsuite/tests/codeGen/should_run/T21186.stdout2
-rw-r--r--testsuite/tests/codeGen/should_run/all.T1
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/T21186.hs b/testsuite/tests/codeGen/should_run/T21186.hs
new file mode 100644
index 0000000000..6f61439a5c
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T21186.hs
@@ -0,0 +1,13 @@
+import Data.Int
+
+f :: Int32 -> String
+f (-5) = "hello"
+f (-4) = "world"
+f (-3) = "figs"
+f (-2) = "sparkle"
+f (-1) = "ficus"
+f (0) = "wombat"
+f (1) = "turtle"
+{-# NOINLINE f #-}
+
+main = putStrLn (f (-5))
diff --git a/testsuite/tests/codeGen/should_run/T21186.stdout b/testsuite/tests/codeGen/should_run/T21186.stdout
new file mode 100644
index 0000000000..9a80a22527
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T21186.stdout
@@ -0,0 +1,2 @@
+hello
+
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 155cfadb87..88db0c6b14 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -216,3 +216,4 @@ test('CallConv', [when(unregisterised(), skip),
when(arch('x86_64'), extra_hc_opts('CallConv_x86_64.s')),
when(arch('aarch64'), extra_hc_opts('CallConv_aarch64.s'))],
compile_and_run, [''])
+test('T21186', normal, compile_and_run, [''])