summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/codeGen/should_run/T16449_2.hs4
-rw-r--r--testsuite/tests/codeGen/should_run/T16449_2.stderr1
-rw-r--r--testsuite/tests/codeGen/should_run/T16449_2.stdout2
-rw-r--r--testsuite/tests/codeGen/should_run/all.T2
4 files changed, 7 insertions, 2 deletions
diff --git a/testsuite/tests/codeGen/should_run/T16449_2.hs b/testsuite/tests/codeGen/should_run/T16449_2.hs
index 3424d43e25..acb885369c 100644
--- a/testsuite/tests/codeGen/should_run/T16449_2.hs
+++ b/testsuite/tests/codeGen/should_run/T16449_2.hs
@@ -5,5 +5,9 @@ module Main where
import GHC.Prim
import GHC.Int
+-- Test that large unchecked shifts, which constitute undefined behavior, do
+-- not crash the compiler and instead evaluate to 0.
+-- See Note [Guarding against silly shifts] in PrelRules.
+
-- Shift should be larger than the word size (e.g. 64 on 64-bit) for this test.
main = print (I# (uncheckedIShiftL# 1# 1000#))
diff --git a/testsuite/tests/codeGen/should_run/T16449_2.stderr b/testsuite/tests/codeGen/should_run/T16449_2.stderr
deleted file mode 100644
index 869a5b0f91..0000000000
--- a/testsuite/tests/codeGen/should_run/T16449_2.stderr
+++ /dev/null
@@ -1 +0,0 @@
-T16449_2: Bad shift length 1000
diff --git a/testsuite/tests/codeGen/should_run/T16449_2.stdout b/testsuite/tests/codeGen/should_run/T16449_2.stdout
new file mode 100644
index 0000000000..77ac542d4f
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T16449_2.stdout
@@ -0,0 +1,2 @@
+0
+
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 5545c9ebb0..535ca8651e 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -196,4 +196,4 @@ test('T15892',
extra_run_opts('+RTS -G1 -A32k -RTS') ],
compile_and_run, ['-O'])
test('T16617', normal, compile_and_run, [''])
-test('T16449_2', [expect_broken_for(16742, ['dyn', 'ghci', 'optasm', 'threaded2']), exit_code(1)], compile_and_run, [''])
+test('T16449_2', exit_code(0), compile_and_run, [''])