From e13ad2cb1cdc7bb67f582a87af6f3631fd11eef7 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Thu, 4 Mar 2021 18:05:14 +0000 Subject: Fixes to dealing with the export of main It's surprisingly tricky to deal with 'main' (#19397). This patch does quite bit of refactoring do to it right. Well, more-right anyway! The moving parts are documented in GHC.Tc.Module Note [Dealing with main] Some other oddments: * Rename tcRnExports to rnExports; no typechecking here! * rnExports now uses checkNoErrs rather than failIfErrsM; the former fails only if rnExports itself finds errors * Small improvements to tcTyThingCategory, which ultimately weren't important to the patch, but I've retained as a minor improvement. --- testsuite/tests/typecheck/should_run/all.T | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testsuite/tests/typecheck/should_run/all.T') diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index f69cc71352..7468511779 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -140,6 +140,8 @@ test('T16453M1', extra_files(['T16453T.hs']), compile_and_run, ['']) test('T16453M2', extra_files(['T16453T.hs']), compile_and_run, ['']) test('T16453M3', extra_files(['T16453T.hs']), compile_and_run, ['']) test('T16453M4', extra_files(['T16453T.hs']), compile_and_run, ['']) +test('T16453M5', extra_files(['T16453T.hs']), compile_and_run, ['']) +test('T16453M6', extra_files(['T16453T.hs']), compile_and_run, ['-main-is foo']) test('UnliftedNewtypesRun', normal, compile_and_run, ['']) test('UnliftedNewtypesFamilyRun', normal, compile_and_run, ['']) test('UnliftedNewtypesDependentFamilyRun', normal, compile_and_run, ['']) @@ -147,3 +149,8 @@ test('UnliftedNewtypesIdentityRun', normal, compile_and_run, ['']) test('UnliftedNewtypesCoerceRun', normal, compile_and_run, ['']) test('T17104', normal, compile_and_run, ['']) test('T18627', normal, compile_and_run, ['-O']) # Optimisation shows up the bug +test('T19397M0', extra_files(['T19397S.hs']), compile_and_run, ['']) +test('T19397M1', extra_files(['T19397S.hs']), compile_and_run, ['']) +test('T19397M2', extra_files(['T19397S.hs']), compile_and_run, ['-main-is foo']) +test('T19397M3', extra_files(['T19397S.hs']), compile_and_run, ['-main-is foo']) +test('T19397M4', extra_files(['T19397S.hs']), compile_and_run, ['-main-is foo']) -- cgit v1.2.1