summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-06-04 14:31:08 -0400
committerAlp Mestanogullari <alp@well-typed.com>2019-08-14 17:47:25 -0400
commit6329c70a36242849540c93b34903f6188b0ed477 (patch)
treef341da692c9f7707be90939f9e890f28625d5402 /testsuite/tests/ghci
parentaa4d8b07edad74c29acdcf06cf1b4c3ff6b97ffa (diff)
downloadhaskell-6329c70a36242849540c93b34903f6188b0ed477.tar.gz
GHCi supports not-necessarily-lifted join points
Fixes #16509. See Note [Not-necessarily-lifted 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. (This commit removes an old test -- this is really a GHCi problem, not a pattern-synonym problem.) test case: ghci/scripts/T16509
Diffstat (limited to 'testsuite/tests/ghci')
-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 8448e3f012..609cbf0592 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -301,5 +301,6 @@ test('T16563', extra_hc_opts("-clear-package-db -global-package-db"), ghci_scrip
test('T16569', normal, ghci_script, ['T16569.script'])
test('T16767', normal, ghci_script, ['T16767.script'])
test('T16575', normal, ghci_script, ['T16575.script'])
+test('T16509', normal, ghci_script, ['T16509.script'])
test('T16804', extra_files(['T16804a.hs', 'T16804b.hs']), ghci_script, ['T16804.script'])
test('T15546', normal, ghci_script, ['T15546.script'])