summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-07 14:27:33 -0400
committerBen Gamari <ben@smart-cactus.org>2020-11-11 23:14:11 -0500
commit787e93ae141ae0f33bc36895494d48a2a5e49e08 (patch)
treebaec46cb84e39330028df74cac7c33135eda855f
parent5506f1342e51bad71a7525ddad0650d1ac63afeb (diff)
downloadhaskell-787e93ae141ae0f33bc36895494d48a2a5e49e08.tar.gz
testsuite: Add testcase for #18733
-rw-r--r--testsuite/tests/driver/T18733/Library1.hs7
-rw-r--r--testsuite/tests/driver/T18733/Library2.hs7
-rw-r--r--testsuite/tests/driver/T18733/Main.hs5
-rw-r--r--testsuite/tests/driver/T18733/Makefile12
-rw-r--r--testsuite/tests/driver/T18733/T18733.stdout2
-rw-r--r--testsuite/tests/driver/T18733/all.T2
6 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T18733/Library1.hs b/testsuite/tests/driver/T18733/Library1.hs
new file mode 100644
index 0000000000..a05015ed1f
--- /dev/null
+++ b/testsuite/tests/driver/T18733/Library1.hs
@@ -0,0 +1,7 @@
+module Library where
+
+data A = ARecu B | ABase String deriving (Show)
+data B = BRecu A | BBase Int deriving (Show)
+
+info :: B
+info = BBase 1
diff --git a/testsuite/tests/driver/T18733/Library2.hs b/testsuite/tests/driver/T18733/Library2.hs
new file mode 100644
index 0000000000..bd0283dd0f
--- /dev/null
+++ b/testsuite/tests/driver/T18733/Library2.hs
@@ -0,0 +1,7 @@
+module Library where
+
+data A = ARecu B | ABase String deriving (Show)
+data B = BRecu A | BBase Int deriving (Show)
+
+info :: A
+info = ABase "Hello"
diff --git a/testsuite/tests/driver/T18733/Main.hs b/testsuite/tests/driver/T18733/Main.hs
new file mode 100644
index 0000000000..6a09b6d4e4
--- /dev/null
+++ b/testsuite/tests/driver/T18733/Main.hs
@@ -0,0 +1,5 @@
+module Main where
+
+import Library
+
+main = putStrLn $ show info
diff --git a/testsuite/tests/driver/T18733/Makefile b/testsuite/tests/driver/T18733/Makefile
new file mode 100644
index 0000000000..457b23a09f
--- /dev/null
+++ b/testsuite/tests/driver/T18733/Makefile
@@ -0,0 +1,12 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+T18733:
+ cp Library1.hs Library.hs
+ '$(TEST_HC)' -v0 -o Main Library.hs Main.hs
+ ./Main
+
+ cp Library2.hs Library.hs
+ '$(TEST_HC)' -v0 -o Main Library.hs Main.hs
+ ./Main
diff --git a/testsuite/tests/driver/T18733/T18733.stdout b/testsuite/tests/driver/T18733/T18733.stdout
new file mode 100644
index 0000000000..aa6c9f761e
--- /dev/null
+++ b/testsuite/tests/driver/T18733/T18733.stdout
@@ -0,0 +1,2 @@
+BBase 1
+ABase "Hello"
diff --git a/testsuite/tests/driver/T18733/all.T b/testsuite/tests/driver/T18733/all.T
new file mode 100644
index 0000000000..233563b1ce
--- /dev/null
+++ b/testsuite/tests/driver/T18733/all.T
@@ -0,0 +1,2 @@
+srcs = ['Library1.hs', 'Library2.hs', 'Main.hs']
+test('T18733', extra_files(srcs), makefile_test, [])