summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-06-14 20:53:42 -0400
committerBen Gamari <ben@smart-cactus.org>2022-07-20 22:37:31 -0400
commit126e3753e2dd63a0800e3ee0c79868a15407b55e (patch)
treede182f84ff6f94ac4ad723f11690e9acbcbb84c9
parenta51b5001149b234dbf4d655fd8da35b28b60b7a0 (diff)
downloadhaskell-126e3753e2dd63a0800e3ee0c79868a15407b55e.tar.gz
testsuite: Add test for #21624
Ensuring that mulIntMayOflo# behaves as expected. (cherry picked from commit 83e0efe12874108cf957ab5cdd49b7da217d3bb8)
-rw-r--r--testsuite/tests/primops/should_run/T21624.hs11
-rw-r--r--testsuite/tests/primops/should_run/T21624.stdout1
-rw-r--r--testsuite/tests/primops/should_run/all.T2
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/primops/should_run/T21624.hs b/testsuite/tests/primops/should_run/T21624.hs
new file mode 100644
index 0000000000..4b08fbd732
--- /dev/null
+++ b/testsuite/tests/primops/should_run/T21624.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE MagicHash #-}
+
+import GHC.Int
+import GHC.Prim
+
+mulIntMayOflo :: Int -> Int -> Bool
+mulIntMayOflo (I# x) (I# y) = I# (mulIntMayOflo# x y) /= 0
+
+main :: IO ()
+main = print (mulIntMayOflo maxBound 0x4)
+
diff --git a/testsuite/tests/primops/should_run/T21624.stdout b/testsuite/tests/primops/should_run/T21624.stdout
new file mode 100644
index 0000000000..0ca95142bb
--- /dev/null
+++ b/testsuite/tests/primops/should_run/T21624.stdout
@@ -0,0 +1 @@
+True
diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T
index b4a4b1f612..65c24b1d00 100644
--- a/testsuite/tests/primops/should_run/all.T
+++ b/testsuite/tests/primops/should_run/all.T
@@ -57,3 +57,5 @@ test('UnliftedStablePtr', normal, compile_and_run, [''])
test('UnliftedTVar1', normal, compile_and_run, [''])
test('UnliftedTVar2', normal, compile_and_run, [''])
test('UnliftedWeakPtr', normal, compile_and_run, [''])
+
+test('T21624', normal, compile_and_run, [''])