Add test for #16038
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Sat, 22 Dec 2018 07:11:49 +0000 (10:11 +0300)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Sat, 22 Dec 2018 07:22:03 +0000 (10:22 +0300)
testsuite/tests/simplCore/should_compile/T16038/A.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T16038/A.hs-boot [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T16038/B.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T16038/Makefile [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T16038/T16038.stdout [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T16038/test.T [new file with mode: 0644]

diff --git a/testsuite/tests/simplCore/should_compile/T16038/A.hs b/testsuite/tests/simplCore/should_compile/T16038/A.hs
new file mode 100644 (file)
index 0000000..3e5137b
--- /dev/null
@@ -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 (file)
index 0000000..48f6768
--- /dev/null
@@ -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 (file)
index 0000000..9eb315a
--- /dev/null
@@ -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 (file)
index 0000000..73ddc7b
--- /dev/null
@@ -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 (file)
index 0000000..f52fd1b
--- /dev/null
@@ -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 (file)
index 0000000..be525b2
--- /dev/null
@@ -0,0 +1,4 @@
+test('T16038',
+     [extra_files(['A.hs', 'A.hs-boot', 'B.hs'])],
+     run_command,
+     ['$MAKE -s --no-print-directory T16038'])