From 787e93ae141ae0f33bc36895494d48a2a5e49e08 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 7 Oct 2020 14:27:33 -0400 Subject: testsuite: Add testcase for #18733 --- testsuite/tests/driver/T18733/Library1.hs | 7 +++++++ testsuite/tests/driver/T18733/Library2.hs | 7 +++++++ testsuite/tests/driver/T18733/Main.hs | 5 +++++ testsuite/tests/driver/T18733/Makefile | 12 ++++++++++++ testsuite/tests/driver/T18733/T18733.stdout | 2 ++ testsuite/tests/driver/T18733/all.T | 2 ++ 6 files changed, 35 insertions(+) create mode 100644 testsuite/tests/driver/T18733/Library1.hs create mode 100644 testsuite/tests/driver/T18733/Library2.hs create mode 100644 testsuite/tests/driver/T18733/Main.hs create mode 100644 testsuite/tests/driver/T18733/Makefile create mode 100644 testsuite/tests/driver/T18733/T18733.stdout create mode 100644 testsuite/tests/driver/T18733/all.T 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, []) -- cgit v1.2.1