diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-06-14 20:53:42 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-06-17 16:19:27 +0000 |
commit | 83e0efe12874108cf957ab5cdd49b7da217d3bb8 (patch) | |
tree | 851c9b992a417a759579a4d5467cc86a36b34440 | |
parent | 5dcc2c84409c2c3f97198b4116c47e861aafd1fb (diff) | |
download | haskell-wip/T21624.tar.gz |
testsuite: Add test for #21624wip/T21624
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, ['']) |