summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-27 23:00:16 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-07 18:43:26 -0400
commit76d5c62aa2a1020abb3a9c74f2b73788474f4804 (patch)
tree54571ffaf6d3504692eb0d64173727d41ea5a231
parent1afb499583f741a95cceb3207c5455c8ec6f5b87 (diff)
downloadhaskell-wip/T16509-test.tar.gz
testsuite: Add test for #16509wip/T16509-test
-rw-r--r--testsuite/tests/patsyn/should_compile/T16509.hs12
-rw-r--r--testsuite/tests/patsyn/should_compile/T16509.script1
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T1
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T16509.hs b/testsuite/tests/patsyn/should_compile/T16509.hs
new file mode 100644
index 0000000000..b848811119
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T16509.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE ViewPatterns #-}
+
+module PatternPanic where
+
+pattern TestPat :: (Int, Int)
+pattern TestPat <- (isSameRef -> True, 0)
+
+isSameRef :: Int -> Bool
+isSameRef e | 0 <- e = True
+isSameRef _ = False
+
diff --git a/testsuite/tests/patsyn/should_compile/T16509.script b/testsuite/tests/patsyn/should_compile/T16509.script
new file mode 100644
index 0000000000..fd4714a9b5
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T16509.script
@@ -0,0 +1 @@
+:load T16509.hs
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 2ac343f635..15369b657e 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -77,5 +77,6 @@ test('T14326', normal, compile, [''])
test('T14394', normal, ghci_script, ['T14394.script'])
test('T14552', normal, compile, [''])
test('T14498', normal, compile, [''])
+test('T16509', expect_broken(16509), ghci_script, ['T16509.script'])
test('T16682', [extra_files(['T16682.hs', 'T16682a.hs'])],
multimod_compile, ['T16682', '-v0 -fwarn-incomplete-patterns -fno-code'])