[commit: ghc] master: Add regression test for #11303 (adcbc98)

git at git.haskell.org git at git.haskell.org
Tue Dec 29 19:42:02 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/adcbc98f50cd6bb01dfcf4c98ad5fe414f7cc40c/ghc

>---------------------------------------------------------------

commit adcbc98f50cd6bb01dfcf4c98ad5fe414f7cc40c
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Dec 29 20:42:19 2015 +0100

    Add regression test for #11303
    
    
    Test Plan: Validate
    
    Reviewers: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1719
    
    GHC Trac Issues: #11303


>---------------------------------------------------------------

adcbc98f50cd6bb01dfcf4c98ad5fe414f7cc40c
 testsuite/tests/pmcheck/should_compile/T11303.hs | 28 ++++++++++++++++++++++++
 testsuite/tests/pmcheck/should_compile/all.T     |  3 +--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/testsuite/tests/pmcheck/should_compile/T11303.hs b/testsuite/tests/pmcheck/should_compile/T11303.hs
new file mode 100644
index 0000000..3989b99
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T11303.hs
@@ -0,0 +1,28 @@
+import System.Environment
+
+-- This covers #11303, wherein the pattern checker would explode
+-- when it encountered patterns sharing a prefix.
+
+main :: IO ()
+main = do
+  args <- getArgs
+  print $ case head args of
+                      "--primop-primop-info"  -> "turtle"
+                      "--primop-tag" -> "asdf"
+                      "--primop-list"  -> "casdhf"
+                      "--primop-vector-uniques"  -> "this"
+                      "--primop-vector-tys"  -> "is"
+                      "--primop-vector-tys-exports"  -> "silly"
+                      "--primop-vector-tycons"  -> "hmmm"
+                      "--primop-vector-turtles"  -> "hmmm"
+                      "--primop-vector-plugs"  -> "hmmm"
+                      "--primop-vector-caps"  -> "hmmm"
+                      "--primop-vector-wires"  -> "hmmm"
+                      "--primop-vector-tornado"  -> "hmmm"
+                      "--primop-vector-tomato"  -> "hmmm"
+                      "--primop-vector-maps"  -> "hmmm"
+                      "--primop-vector-paper"  -> "hmmm"
+                      "--make-haskell-wrappers" -> "123512"
+                      "--make-haskell-source"  -> "as;dg"
+                      "--make-latex-doc" -> "adghiw"
+                      _ -> error "Should not happen, known_args out of sync?"
diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T
index 8ff797a..3bd4118 100644
--- a/testsuite/tests/pmcheck/should_compile/all.T
+++ b/testsuite/tests/pmcheck/should_compile/all.T
@@ -22,6 +22,7 @@ test('T7669a', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patter
 test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
+test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 
 # Other tests
 test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
@@ -31,5 +32,3 @@ test('pmc004', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patter
 test('pmc005', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('pmc006', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('pmc007', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
-
-



More information about the ghc-commits mailing list