diff options
author | Roland Senn <rsx@bluewin.ch> | 2020-07-05 14:28:59 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-31 23:00:27 -0400 |
commit | e5969fd06ad4b4c31a8bdce51d35f9aa05594b49 (patch) | |
tree | ebf8eaf252c2179af7a5f00c402128c656fa7571 /testsuite/tests/deSugar | |
parent | f6d70a8ff6a6cd628738fec902fc984936105264 (diff) | |
download | haskell-e5969fd06ad4b4c31a8bdce51d35f9aa05594b49.tar.gz |
Add additional tests for #18172 (Followup MR 3543)
There was still one active discussion [thread](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3543#note_284325) when MR !3543 got merged.
This MR adds the requested tests exercising the changes in
`compiler/GHC/HsToCore/Match/Literal.hs:warnAboutEmptyEnumerations` and its sub-functions.
Diffstat (limited to 'testsuite/tests/deSugar')
-rw-r--r-- | testsuite/tests/deSugar/should_run/T18172.script | 7 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/T18172.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/T18172.stdout | 6 |
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/T18172.script b/testsuite/tests/deSugar/should_run/T18172.script index f0226e85c4..f5c4bef61b 100644 --- a/testsuite/tests/deSugar/should_run/T18172.script +++ b/testsuite/tests/deSugar/should_run/T18172.script @@ -20,3 +20,10 @@ ZipList [259] :: ZipList Word8 :l T18172.hs Wombat [4, 264, 10] + +[1..5]::[Int] +[5..2]::[Int] +[6..9]::[Integer] +[9..6]::[Integer] +[10..15]::[Word8] +[15..10]::[Word8] diff --git a/testsuite/tests/deSugar/should_run/T18172.stderr b/testsuite/tests/deSugar/should_run/T18172.stderr index f5771d8121..64f6646668 100644 --- a/testsuite/tests/deSugar/should_run/T18172.stderr +++ b/testsuite/tests/deSugar/should_run/T18172.stderr @@ -45,3 +45,12 @@ <interactive>:22:12: warning: [-Woverflowed-literals (in -Wdefault)] Literal 264 is out of the Word8 range 0..255 + +<interactive>:25:1: warning: [-Wempty-enumerations (in -Wdefault)] + Enumeration is empty + +<interactive>:27:1: warning: [-Wempty-enumerations (in -Wdefault)] + Enumeration is empty + +<interactive>:29:1: warning: [-Wempty-enumerations (in -Wdefault)] + Enumeration is empty diff --git a/testsuite/tests/deSugar/should_run/T18172.stdout b/testsuite/tests/deSugar/should_run/T18172.stdout index 8f30df2597..2f1c2807f0 100644 --- a/testsuite/tests/deSugar/should_run/T18172.stdout +++ b/testsuite/tests/deSugar/should_run/T18172.stdout @@ -12,3 +12,9 @@ ZipList {getZipList = [3]} [] [] Wombat [4,8,10] +[1,2,3,4,5] +[] +[6,7,8,9] +[] +[10,11,12,13,14,15] +[] |