summaryrefslogtreecommitdiff
path: root/testsuite/tests/module
diff options
context:
space:
mode:
authorChris Smith <cdsmith@gmail.com>2018-11-17 12:40:23 +0100
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-11-17 13:52:26 +0100
commit0e7790abf7d19d19f84c86dc95e50beb65462d12 (patch)
tree4868453d4f01abd14543317e7a0e3a93d73f2d19 /testsuite/tests/module
parent798c943781e14b7111431d3c7193c93fcc5ffa3e (diff)
downloadhaskell-0e7790abf7d19d19f84c86dc95e50beb65462d12.tar.gz
Fix trac #15702, as a followon to fix for #13704.
Summary: The effect of this change is that -main-is changes the default export list for the main module, but does not apply the same change to non-main modules. This fixes some cases where -main-is was used to wrap a module that expected that default behavior (exporting `main`, even when that wasn't the main entry point name). Reviewers: mpickering, monoidal, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #13704, #15702 Differential Revision: https://phabricator.haskell.org/D5322
Diffstat (limited to 'testsuite/tests/module')
-rw-r--r--testsuite/tests/module/T13704a.hs (renamed from testsuite/tests/module/T13704.hs)0
-rw-r--r--testsuite/tests/module/T13704b1.hs4
-rw-r--r--testsuite/tests/module/T13704b2.hs7
-rw-r--r--testsuite/tests/module/all.T3
4 files changed, 13 insertions, 1 deletions
diff --git a/testsuite/tests/module/T13704.hs b/testsuite/tests/module/T13704a.hs
index 38b1cb73fc..38b1cb73fc 100644
--- a/testsuite/tests/module/T13704.hs
+++ b/testsuite/tests/module/T13704a.hs
diff --git a/testsuite/tests/module/T13704b1.hs b/testsuite/tests/module/T13704b1.hs
new file mode 100644
index 0000000000..28b8800706
--- /dev/null
+++ b/testsuite/tests/module/T13704b1.hs
@@ -0,0 +1,4 @@
+main :: IO ()
+main = return ()
+
+-- wrapped by T13704b2.hs
diff --git a/testsuite/tests/module/T13704b2.hs b/testsuite/tests/module/T13704b2.hs
new file mode 100644
index 0000000000..d76206fe42
--- /dev/null
+++ b/testsuite/tests/module/T13704b2.hs
@@ -0,0 +1,7 @@
+module T13704b2 where
+import Main (main)
+
+program :: IO ()
+program = main
+
+-- meant to be compiled with '-main-is T13704b2.program'
diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T
index dbba44f0ba..33ce3aeefe 100644
--- a/testsuite/tests/module/all.T
+++ b/testsuite/tests/module/all.T
@@ -284,4 +284,5 @@ test('T11970B', normal, compile_fail, [''])
test('MultiExport', normal, compile, [''])
test('T13528', normal, compile, [''])
test('T13622', normal, compile, [''])
-test('T13704', normal, compile, ['-main-is Main.program'])
+test('T13704a', normal, compile, ['-main-is Main.program'])
+test('T13704b', [], multimod_compile, ['T13704b1.hs T13704b2.hs', '-main-is T13704b2.program -v0'])