summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/printer/T17697.hs7
-rw-r--r--testsuite/tests/printer/T17697.stderr7
-rw-r--r--testsuite/tests/printer/all.T1
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/printer/T17697.hs b/testsuite/tests/printer/T17697.hs
new file mode 100644
index 0000000000..a7fe4feedb
--- /dev/null
+++ b/testsuite/tests/printer/T17697.hs
@@ -0,0 +1,7 @@
+{-# OPTIONS_GHC -Wunused-do-bind -fdefer-out-of-scope-variables #-}
+module T17697 where
+
+main :: IO ()
+main = do
+ threadDelay 1
+ return ()
diff --git a/testsuite/tests/printer/T17697.stderr b/testsuite/tests/printer/T17697.stderr
new file mode 100644
index 0000000000..cdd9e7fc29
--- /dev/null
+++ b/testsuite/tests/printer/T17697.stderr
@@ -0,0 +1,7 @@
+
+T17697.hs:6:5: warning: [-Wdeferred-out-of-scope-variables (in -Wdefault)]
+ Variable not in scope: threadDelay :: t0 -> IO a0
+
+T17697.hs:6:5: warning: [-Wunused-do-bind (in -Wall)]
+ A do-notation statement discarded a result of type ‘GHC.Types.Any’
+ Suggested fix: Suppress this warning by saying ‘_ <- threadDelay 1’
diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T
index 1de996cb9c..1740dd497a 100644
--- a/testsuite/tests/printer/all.T
+++ b/testsuite/tests/printer/all.T
@@ -68,6 +68,7 @@ test('T14306', ignore_stderr, makefile_test, ['T14306'])
test('T14343', normal, compile_fail, [''])
test('T14343b', normal, compile_fail, [''])
test('T15761', normal, compile_fail, [''])
+test('T17697', normal, compile, [''])
test('T18052a', normal, compile,
['-ddump-simpl -ddump-types -dno-typeable-binds -dsuppress-uniques'])
test('T18791', normal, compile, ['-ddump-parsed-ast'])