testsuite: Add testcase for #16111
authorBen Gamari <ben@smart-cactus.org>
Fri, 29 Mar 2019 21:26:05 +0000 (17:26 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 26 Jun 2019 17:46:33 +0000 (13:46 -0400)
(cherry picked from commit 3acdc9a8844a5f9bddf27379b3e74c2bb94bff5f)

libraries/base/tests/T16111.hs [new file with mode: 0644]
libraries/base/tests/T16111.stderr [new file with mode: 0644]
libraries/base/tests/all.T

diff --git a/libraries/base/tests/T16111.hs b/libraries/base/tests/T16111.hs
new file mode 100644 (file)
index 0000000..241714e
--- /dev/null
@@ -0,0 +1,13 @@
+module Main (main) where
+
+import Data.Bits
+import Data.Word
+
+main :: IO ()
+main = print $ toInteger (shiftL 1 hm :: Word64)
+            == toInteger (shiftL 1 hm :: Word64)
+
+hm :: Int
+hm = -1
+{-# NOINLINE hm #-}
+
diff --git a/libraries/base/tests/T16111.stderr b/libraries/base/tests/T16111.stderr
new file mode 100644 (file)
index 0000000..7562f9d
--- /dev/null
@@ -0,0 +1,2 @@
+T16111: arithmetic overflow
+
index 9cb9c95..4ef2f07 100644 (file)
@@ -233,3 +233,4 @@ test('T10412', normal, compile_and_run, [''])
 test('T13896', normal, compile_and_run, [''])
 test('T13167', fragile_for(16536, ['threaded2']), compile_and_run, [''])
 test('T15349', [exit_code(1), expect_broken_for(15349, 'ghci')], compile_and_run, [''])
+test('T16111', exit_code(1), compile_and_run, [''])