summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2018-12-22 10:11:49 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2018-12-22 10:22:03 +0300
commit8adef36cb16b244a81dfb54ead924e00069f33ae (patch)
treec2aebba05f3c5c88259561ee933a581501449dba
parent6d2f6df3543bc287e59151e823b7a62c245c27b0 (diff)
downloadhaskell-8adef36cb16b244a81dfb54ead924e00069f33ae.tar.gz
Add test for #16038
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/A.hs9
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/A.hs-boot6
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/B.hs7
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/Makefile10
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/T16038.stdout8
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/test.T4
6 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T16038/A.hs b/testsuite/tests/simplCore/should_compile/T16038/A.hs
new file mode 100644
index 0000000000..3e5137bf94
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/A.hs
@@ -0,0 +1,9 @@
+module A where
+
+import B
+
+data HsExpr id
+ = HsOverLit (HsOverLit id)
+ | HsBracketOut (HsExpr id)
+ deriving Eq
+
diff --git a/testsuite/tests/simplCore/should_compile/T16038/A.hs-boot b/testsuite/tests/simplCore/should_compile/T16038/A.hs-boot
new file mode 100644
index 0000000000..48f6768e39
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/A.hs-boot
@@ -0,0 +1,6 @@
+module A where
+
+data HsExpr i
+
+instance Eq i => Eq (HsExpr i)
+
diff --git a/testsuite/tests/simplCore/should_compile/T16038/B.hs b/testsuite/tests/simplCore/should_compile/T16038/B.hs
new file mode 100644
index 0000000000..9eb315a419
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/B.hs
@@ -0,0 +1,7 @@
+module B where
+
+import {-# SOURCE #-} A (HsExpr)
+
+data HsOverLit id
+ = OverLit (HsExpr id)
+ deriving Eq
diff --git a/testsuite/tests/simplCore/should_compile/T16038/Makefile b/testsuite/tests/simplCore/should_compile/T16038/Makefile
new file mode 100644
index 0000000000..73ddc7b0ae
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/Makefile
@@ -0,0 +1,10 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+T16038:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c A.hs-boot
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c B.hs
+ # All `fEqHsExpr` bindings should be in one recursive group:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -c A.hs -ddump-simpl -dsuppress-all | \
+ grep -e "^\$$fEqHsExpr" -e "Rec"
diff --git a/testsuite/tests/simplCore/should_compile/T16038/T16038.stdout b/testsuite/tests/simplCore/should_compile/T16038/T16038.stdout
new file mode 100644
index 0000000000..f52fd1b79c
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/T16038.stdout
@@ -0,0 +1,8 @@
+Rec {
+$fEqHsExpr_$c/=
+$fEqHsExpr_$c/=
+$fEqHsExpr
+$fEqHsExpr
+$fEqHsExpr_$c==
+$fEqHsExpr_$c==
+end Rec }
diff --git a/testsuite/tests/simplCore/should_compile/T16038/test.T b/testsuite/tests/simplCore/should_compile/T16038/test.T
new file mode 100644
index 0000000000..be525b25b0
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T16038/test.T
@@ -0,0 +1,4 @@
+test('T16038',
+ [extra_files(['A.hs', 'A.hs-boot', 'B.hs'])],
+ run_command,
+ ['$MAKE -s --no-print-directory T16038'])