Add regression test for #11303
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 29 Dec 2015 19:42:19 +0000 (20:42 +0100)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Dec 2015 19:42:19 +0000 (20:42 +0100)
Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1719

GHC Trac Issues: #11303

testsuite/tests/pmcheck/should_compile/T11303.hs [new file with mode: 0644]
testsuite/tests/pmcheck/should_compile/all.T

diff --git a/testsuite/tests/pmcheck/should_compile/T11303.hs b/testsuite/tests/pmcheck/should_compile/T11303.hs
new file mode 100644 (file)
index 0000000..3989b99
--- /dev/null
@@ -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?"
index 8ff797a..3bd4118 100644 (file)
@@ -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'])
-
-