testsuite: Add test for #14128
authorBen Gamari <bgamari.foss@gmail.com>
Sat, 26 Aug 2017 20:16:47 +0000 (16:16 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Aug 2017 13:54:07 +0000 (09:54 -0400)
Reviewers: austin, goldfire

Subscribers: rwbarton, thomie

GHC Trac Issues: #14128

Differential Revision: https://phabricator.haskell.org/D3890

testsuite/tests/typecheck/should_compile/T14128.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14128.hs-boot [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14128Main.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14128Type.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14128a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T14128a.hs-boot [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T14128.hs b/testsuite/tests/typecheck/should_compile/T14128.hs
new file mode 100644 (file)
index 0000000..a1159c6
--- /dev/null
@@ -0,0 +1,7 @@
+module T14128 where
+
+import T14128Type
+import {-# SOURCE #-} T14128a
+
+instance Show AType where
+    show AType = "hello"
diff --git a/testsuite/tests/typecheck/should_compile/T14128.hs-boot b/testsuite/tests/typecheck/should_compile/T14128.hs-boot
new file mode 100644 (file)
index 0000000..27ef36a
--- /dev/null
@@ -0,0 +1,5 @@
+module T14128 where
+
+import T14128Type
+
+instance Show AType
diff --git a/testsuite/tests/typecheck/should_compile/T14128Main.hs b/testsuite/tests/typecheck/should_compile/T14128Main.hs
new file mode 100644 (file)
index 0000000..9407606
--- /dev/null
@@ -0,0 +1,10 @@
+module T14128Main where
+
+import T14128
+
+-- Overview:
+--   * T14128Main is imports T14128
+--   * T14128Type defines datatype MyType
+--   * T14128 has a boot file and defines a orphan Show instance; it SOURCE
+--     imports T14128
+--   * T14128a has a boot file which SOURCE imports T14128
diff --git a/testsuite/tests/typecheck/should_compile/T14128Type.hs b/testsuite/tests/typecheck/should_compile/T14128Type.hs
new file mode 100644 (file)
index 0000000..f64ec48
--- /dev/null
@@ -0,0 +1,3 @@
+module T14128Type where
+
+data AType = AType
diff --git a/testsuite/tests/typecheck/should_compile/T14128a.hs b/testsuite/tests/typecheck/should_compile/T14128a.hs
new file mode 100644 (file)
index 0000000..a93b2fe
--- /dev/null
@@ -0,0 +1 @@
+module T14128a where
diff --git a/testsuite/tests/typecheck/should_compile/T14128a.hs-boot b/testsuite/tests/typecheck/should_compile/T14128a.hs-boot
new file mode 100644 (file)
index 0000000..e38681a
--- /dev/null
@@ -0,0 +1,3 @@
+module T14128a where
+
+import {-# SOURCE #-} T14128
index b929195..fde7bae 100644 (file)
@@ -571,5 +571,6 @@ test('T13881', normal, compile, [''])
 test('T13915a', normal, multimod_compile, ['T13915a', '-v0'])
 test('T13915b', normal, compile, [''])
 test('T13984', normal, compile, [''])
+test('T14128', normal, multimod_compile, ['T14128Main', '-v0'])
 test('T14149', normal, compile, [''])
 test('T14154', normal, compile, [''])