summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-06-02 16:59:47 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-18 15:38:55 -0400
commit3ac6ae7c8d5a66bfe36973d1e92f3feef482d589 (patch)
tree6b0c2128caefe6c4f6dba9cd9cf5896e113223d9
parentf4cc57fa2df08f5b33a4cf86c3e041b8de9f6ebf (diff)
downloadhaskell-3ac6ae7c8d5a66bfe36973d1e92f3feef482d589.tar.gz
testsuite: Add test for #18291
-rw-r--r--testsuite/tests/codeGen/should_compile/T18291.hs7
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T1
2 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_compile/T18291.hs b/testsuite/tests/codeGen/should_compile/T18291.hs
new file mode 100644
index 0000000000..e7ea4a08a8
--- /dev/null
+++ b/testsuite/tests/codeGen/should_compile/T18291.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE MagicHash #-}
+module T18291 where
+
+import GHC.Magic
+
+hi :: Int
+hi = runRW# $ \_ -> 42
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index 73c80e786e..4e0a25b7d5 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -91,6 +91,7 @@ test('T17648', normal, makefile_test, [])
test('T17904', normal, compile, ['-O'])
test('T18227A', normal, compile, [''])
test('T18227B', normal, compile, [''])
+test('T18291', normal, compile, ['-O0'])
test('T15570',
when(unregisterised(), skip),
compile, ['-Wno-overflowed-literals'])