[commit: ghc] master: Add test for #16038 (8adef36)

git at git.haskell.org git at git.haskell.org
Sat Dec 22 07:22:26 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8adef36cb16b244a81dfb54ead924e00069f33ae/ghc

>---------------------------------------------------------------

commit 8adef36cb16b244a81dfb54ead924e00069f33ae
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sat Dec 22 10:11:49 2018 +0300

    Add test for #16038


>---------------------------------------------------------------

8adef36cb16b244a81dfb54ead924e00069f33ae
 testsuite/tests/simplCore/should_compile/T16038/A.hs           |  9 +++++++++
 testsuite/tests/simplCore/should_compile/T16038/A.hs-boot      |  6 ++++++
 testsuite/tests/simplCore/should_compile/T16038/B.hs           |  7 +++++++
 testsuite/tests/simplCore/should_compile/T16038/Makefile       | 10 ++++++++++
 testsuite/tests/simplCore/should_compile/T16038/T16038.stdout  |  8 ++++++++
 .../T13710/all.T => simplCore/should_compile/T16038/test.T}    |  4 ++--
 6 files changed, 42 insertions(+), 2 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 0000000..3e5137b
--- /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 0000000..48f6768
--- /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 0000000..9eb315a
--- /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 0000000..73ddc7b
--- /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 0000000..f52fd1b
--- /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/driver/T13710/all.T b/testsuite/tests/simplCore/should_compile/T16038/test.T
similarity index 52%
copy from testsuite/tests/driver/T13710/all.T
copy to testsuite/tests/simplCore/should_compile/T16038/test.T
index 64daacc..be525b2 100644
--- a/testsuite/tests/driver/T13710/all.T
+++ b/testsuite/tests/simplCore/should_compile/T16038/test.T
@@ -1,4 +1,4 @@
-test('T13710',
+test('T16038',
      [extra_files(['A.hs', 'A.hs-boot', 'B.hs'])],
      run_command,
-     ['$MAKE -s --no-print-directory T13710'])
+     ['$MAKE -s --no-print-directory T16038'])



More information about the ghc-commits mailing list