diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-06-28 22:31:35 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-27 21:35:17 -0400 |
commit | cab890f73b534375135d372ba9f7eb8f5f523e16 (patch) | |
tree | bf749f1c24eeeea0da6292267679cbd2a8705ebd /testsuite/tests | |
parent | 97e0837d15bfdfb5bffb561e155f6b523718c773 (diff) | |
download | haskell-cab890f73b534375135d372ba9f7eb8f5f523e16.tar.gz |
Add a regression test for #17697
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/printer/T17697.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/T17697.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/all.T | 1 |
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']) |