summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-06-04 14:31:08 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-25 14:37:38 -0400
commit7ffe0681d44d002af357dd97f81590c804abb324 (patch)
treeddc47e08f844f71bbdd5b192d9e2389106e6d1a3 /testsuite
parentf9da172cde69071121dc8698bc1488b454ab32b2 (diff)
downloadhaskell-7ffe0681d44d002af357dd97f81590c804abb324.tar.gz
GHCi support for levity-polymorphic join points
Fixes #16509. See Note [Levity-polymorphic join points] in ByteCodeGen, which tells the full story. This commit also adds some comments and cleans some code in the byte-code generator, as I was exploring around trying to understand it. test case: ghci/scripts/T16509 (cherry picked from commit 392210bf8a27b3604f8642d76c39e391c2d4b5e0)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/scripts/T16509.hs11
-rw-r--r--testsuite/tests/ghci/scripts/T16509.script1
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T16509.hs b/testsuite/tests/ghci/scripts/T16509.hs
new file mode 100644
index 0000000000..6f35e3c792
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T16509.hs
@@ -0,0 +1,11 @@
+{-# 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/ghci/scripts/T16509.script b/testsuite/tests/ghci/scripts/T16509.script
new file mode 100644
index 0000000000..3e40de0b91
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T16509.script
@@ -0,0 +1 @@
+:l T16509
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 5162a3c220..b6772d4c37 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -295,5 +295,6 @@ test('T15941', normal, ghci_script, ['T15941.script'])
test('T16030', normal, ghci_script, ['T16030.script'])
test('T11606', normal, ghci_script, ['T11606.script'])
test('T16089', normal, ghci_script, ['T16089.script'])
+test('T16509', normal, ghci_script, ['T16509.script'])
test('T16527', normal, ghci_script, ['T16527.script'])
test('T16767', normal, ghci_script, ['T16767.script'])