summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-03-29 17:26:05 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-26 13:46:33 -0400
commitb56b4d8cd3cc880457f69da474bb75184fd94b3f (patch)
tree645177bce69795bad5ed4595cc0147ebba36a667
parent17b084af334dec19d7efffe9bc61e760fbd6c805 (diff)
downloadhaskell-b56b4d8cd3cc880457f69da474bb75184fd94b3f.tar.gz
testsuite: Add testcase for #16111
(cherry picked from commit 3acdc9a8844a5f9bddf27379b3e74c2bb94bff5f)
-rw-r--r--libraries/base/tests/T16111.hs13
-rw-r--r--libraries/base/tests/T16111.stderr2
-rw-r--r--libraries/base/tests/all.T1
3 files changed, 16 insertions, 0 deletions
diff --git a/libraries/base/tests/T16111.hs b/libraries/base/tests/T16111.hs
new file mode 100644
index 0000000000..241714ea13
--- /dev/null
+++ b/libraries/base/tests/T16111.hs
@@ -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
index 0000000000..7562f9de58
--- /dev/null
+++ b/libraries/base/tests/T16111.stderr
@@ -0,0 +1,2 @@
+T16111: arithmetic overflow
+
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index 9cb9c958fb..4ef2f07dd2 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -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, [''])