diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-06-14 20:53:42 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-06-18 10:44:11 -0400 |
commit | 26745006bdecc2d269fd8252b189650d6bd7ac10 (patch) | |
tree | bd65638f502843aee1fac3ede316aa8ec4345cbb | |
parent | a1e1d8eecceaa2fa64668376d5ea44990d94a3ea (diff) | |
download | haskell-26745006bdecc2d269fd8252b189650d6bd7ac10.tar.gz |
testsuite: Add test for #21624
Ensuring that mulIntMayOflo# behaves as expected.
-rw-r--r-- | testsuite/tests/primops/should_run/T21624.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/T21624.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/all.T | 2 |
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, ['']) |