summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-02-08 17:49:28 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-19 06:14:04 -0500
commit9049bfb1773cf114fd4e2d2d6daed46af2b73093 (patch)
treeabc97aab3d5680f1ce2a16e66f8c181cfb0c576a /testsuite/tests/simplCore
parent129a800dd01bff93f64c21bc22a4609cb26fc571 (diff)
downloadhaskell-9049bfb1773cf114fd4e2d2d6daed46af2b73093.tar.gz
Disable binder swap in OccurAnal (Trac #16288)
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r--testsuite/tests/simplCore/should_compile/T16288A.hs17
-rw-r--r--testsuite/tests/simplCore/should_compile/T16288B.hs7
-rw-r--r--testsuite/tests/simplCore/should_compile/T16288C.hs13
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T1
4 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T16288A.hs b/testsuite/tests/simplCore/should_compile/T16288A.hs
new file mode 100644
index 0000000000..c6a52bff33
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16288A.hs
@@ -0,0 +1,17 @@
+module T16288A where
+
+import T16288C
+
+data License
+
+class Pretty a where
+ pretty :: a -> Doc
+
+instance Pretty License where
+ pretty _ = pretV
+
+bar :: (Pretty a) => a -> Doc
+bar w = foo (pretty (u w w w w))
+
+u :: a -> a -> a -> a -> a
+u = u
diff --git a/testsuite/tests/simplCore/should_compile/T16288B.hs b/testsuite/tests/simplCore/should_compile/T16288B.hs
new file mode 100644
index 0000000000..c1a98d2e3a
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16288B.hs
@@ -0,0 +1,7 @@
+module T16288B where
+
+import T16288A
+import T16288C
+
+bar2 :: License -> Doc
+bar2 = bar
diff --git a/testsuite/tests/simplCore/should_compile/T16288C.hs b/testsuite/tests/simplCore/should_compile/T16288C.hs
new file mode 100644
index 0000000000..5efbb2ee34
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16288C.hs
@@ -0,0 +1,13 @@
+module T16288C where
+
+data Doc = Empty | Beside Doc
+
+hcat :: Doc -> Doc
+hcat Empty = Empty
+hcat xs = hcat xs
+
+pretV = hcat Empty
+
+foo :: Doc -> Doc
+foo Empty = hcat Empty
+foo val = Beside val
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 06b5e48447..779b09175e 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -299,3 +299,4 @@ test('T15631',
normal,
makefile_test, ['T15631'])
test('T15673', normal, compile, ['-O'])
+test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0'])