Commit 1bd1ceff authored by Edward Z. Yang's avatar Edward Z. Yang

Don't use self {-# SOURCE #-} import in test-cases.

Summary:
It's kind of buggy, c.f. #10182, and isn't motivated by any
real world programs, so we're going to get rid of it (despite
it being handy for GHC test cases.)
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D862
parent 1bb1ff22
...@@ -5,5 +5,6 @@ include $(TOP)/mk/test.mk ...@@ -5,5 +5,6 @@ include $(TOP)/mk/test.mk
.PHONY: T1133 .PHONY: T1133
T1133: T1133:
'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs-boot '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs-boot
'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
module T1133 where module T1133 where
import {-# SOURCE #-} T1133 import T1133a
newtype X = X Int deriving Enum newtype X = X Int deriving Enum
module T1133a where
import {-# SOURCE #-} T1133
...@@ -32,7 +32,7 @@ test('drv-functor2', normal, compile, ['']) ...@@ -32,7 +32,7 @@ test('drv-functor2', normal, compile, [''])
test('drv-foldable-traversable1', normal, compile, ['']) test('drv-foldable-traversable1', normal, compile, [''])
test('T6031', extra_clean(['T6031a.o', 'T6031a.hi']), multimod_compile, ['T6031', '-v0']) test('T6031', extra_clean(['T6031a.o', 'T6031a.hi']), multimod_compile, ['T6031', '-v0'])
test('T1133', test('T1133',
extra_clean(['T1133.o-boot', 'T1133.hi-boot']), extra_clean(['T1133.o-boot', 'T1133.hi-boot', 'T1133a.o', 'T1133a.hi']),
run_command, run_command,
['$MAKE --no-print-directory -s T1133']) ['$MAKE --no-print-directory -s T1133'])
test('T7704', normal, compile, ['']) test('T7704', normal, compile, [''])
......
...@@ -6,11 +6,8 @@ drvfail016: ...@@ -6,11 +6,8 @@ drvfail016:
$(RM) -f drvfail016.hi-boot drvfail016.o-boot $(RM) -f drvfail016.hi-boot drvfail016.o-boot
'$(TEST_HC)' $(TEST_HC_OPTS) -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$? '$(TEST_HC)' $(TEST_HC_OPTS) -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$?
.PHONY: T1133A Roles12 .PHONY: T1133A
T1133A: T1133A:
'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs-boot '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs-boot
-'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133Aa.hs
-'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs
Roles12:
'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs-boot
-'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs
module T1133A where module T1133A where
import {-# SOURCE #-} T1133A import T1133Aa
newtype X = X Int deriving Enum newtype X = X Int deriving Enum
module T1133Aa where
import {-# SOURCE #-} T1133A
...@@ -35,7 +35,7 @@ test('T5478', normal, compile_fail, ['']) ...@@ -35,7 +35,7 @@ test('T5478', normal, compile_fail, [''])
test('T5686', normal, compile_fail, ['']) test('T5686', normal, compile_fail, [''])
test('T5922', normal, compile_fail, ['']) test('T5922', normal, compile_fail, [''])
test('T1133A', test('T1133A',
extra_clean(['T1133A.o-boot', 'T1133A.hi-boot']), extra_clean(['T1133A.o-boot', 'T1133A.hi-boot', 'T1133Aa.o', 'T1133Aa.hi']),
run_command, run_command,
['$MAKE --no-print-directory -s T1133A']) ['$MAKE --no-print-directory -s T1133A'])
# 5863a was removed as it was out of date re: fixing #9858 # 5863a was removed as it was out of date re: fixing #9858
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module ClosedFam1 where module ClosedFam1 where
import {-# SOURCE #-} ClosedFam1 import ClosedFam1a
type family Foo a where type family Foo a where
Foo Int = Bool Foo Int = Bool
......
module ClosedFam1a where
import {-# SOURCE #-} ClosedFam1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module ClosedFam2 where module ClosedFam2 where
import {-# SOURCE #-} ClosedFam2 import ClosedFam2a
type family Foo a where type family Foo a where
Foo Int = Bool Foo Int = Bool
......
module ClosedFam2a where
import {-# SOURCE #-} ClosedFam2
...@@ -233,9 +233,9 @@ test('T8500', ...@@ -233,9 +233,9 @@ test('T8500',
test('T8018', normal, compile, ['']) test('T8018', normal, compile, [''])
test('T8020', normal, compile, ['']) test('T8020', normal, compile, [''])
test('ClosedFam1', extra_clean(['ClosedFam1.o-boot', 'ClosedFam1.hi-boot']), test('ClosedFam1', extra_clean(['ClosedFam1.o-boot', 'ClosedFam1.hi-boot', 'ClosedFam1a.o', 'ClosedFam1a.hi']),
multimod_compile, ['ClosedFam1', '-v0']) multimod_compile, ['ClosedFam1', '-v0'])
test('ClosedFam2', extra_clean(['ClosedFam2.o-boot', 'ClosedFam2.hi-boot']), test('ClosedFam2', extra_clean(['ClosedFam2.o-boot', 'ClosedFam2.hi-boot', 'ClosedFam2a.o', 'ClosedFam2a.hi']),
multimod_compile, ['ClosedFam2', '-v0']) multimod_compile, ['ClosedFam2', '-v0'])
test('T8651', normal, compile, ['']) test('T8651', normal, compile, [''])
test('T8889', normal, compile, ['']) test('T8889', normal, compile, [''])
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module ClosedFam3 where module ClosedFam3 where
import {-# SOURCE #-} ClosedFam3 import ClosedFam3a
type family Foo a where type family Foo a where
Foo Int = Bool Foo Int = Bool
......
module ClosedFam3a where
import {-# SOURCE #-} ClosedFam3
...@@ -103,7 +103,7 @@ test('T7967', normal, compile_fail, ['']) ...@@ -103,7 +103,7 @@ test('T7967', normal, compile_fail, [''])
test('T7938', normal, compile_fail, ['']) test('T7938', normal, compile_fail, [''])
test('ClosedFam3', extra_clean(['ClosedFam3.o-boot', 'ClosedFam3.hi-boot']), test('ClosedFam3', extra_clean(['ClosedFam3.o-boot', 'ClosedFam3.hi-boot', 'ClosedFam3a.hi', 'ClosedFam3a.o']),
multimod_compile_fail, ['ClosedFam3', '-v0']) multimod_compile_fail, ['ClosedFam3', '-v0'])
test('ClosedFam4', normal, compile_fail, ['']) test('ClosedFam4', normal, compile_fail, [''])
test('T8155', normal, compile_fail, ['']) test('T8155', normal, compile_fail, [''])
......
...@@ -6,8 +6,10 @@ include $(TOP)/mk/test.mk ...@@ -6,8 +6,10 @@ include $(TOP)/mk/test.mk
Roles12: Roles12:
'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs-boot '$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs-boot
'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12a.hs
-'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs
T9204: T9204:
'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs-boot '$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs-boot
-'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204a.hs
-'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs
module Roles12 where module Roles12 where
import {-# SOURCE #-} Roles12 import Roles12a
data T a data T a
module Roles12a where
import {-# SOURCE #-} Roles12
module T9204 where module T9204 where
import {-# SOURCE #-} T9204 import T9204a
data D a data D a
module T9204a where
import {-# SOURCE #-} T9204
...@@ -5,9 +5,9 @@ test('Roles8', normal, compile_fail, ['']) ...@@ -5,9 +5,9 @@ test('Roles8', normal, compile_fail, [''])
test('Roles10', normal, compile_fail, ['']) test('Roles10', normal, compile_fail, [''])
test('Roles11', normal, compile_fail, ['']) test('Roles11', normal, compile_fail, [''])
test('Roles12', test('Roles12',
extra_clean(['Roles12.o-boot', 'Roles12.hi-boot']), extra_clean(['Roles12.o-boot', 'Roles12.hi-boot', 'Roles12a.o', 'Roles12a.hi']),
run_command, ['$MAKE --no-print-directory -s Roles12']) run_command, ['$MAKE --no-print-directory -s Roles12'])
test('T8773', normal, compile_fail, ['']) test('T8773', normal, compile_fail, [''])
test('T9204', extra_clean(['T9204.o-boot', 'T9204.hi-boot']), test('T9204', extra_clean(['T9204.o-boot', 'T9204.hi-boot', 'T9204a.o', 'T9204a.hi-boot']),
run_command, ['$MAKE --no-print-directory -s T9204']) run_command, ['$MAKE --no-print-directory -s T9204'])
test('RolesIArray', normal, compile_fail, ['']) test('RolesIArray', normal, compile_fail, [''])
module T8743 where module T8743 where
-- Without the following import, it does not fail -- Without the following import, it does not fail
import {-# SOURCE #-} T8743 () import T8743a ()
-- [()] required, () does not work. -- [()] required, () does not work.
class ToRow a where toRow :: a -> [()] class ToRow a where toRow :: a -> [()]
......
module T8743a where
import {-# SOURCE #-} T8743 ()
...@@ -18,7 +18,7 @@ test('newtype', req_profiling, compile, ['-prof -auto-all']) ...@@ -18,7 +18,7 @@ test('newtype', req_profiling, compile, ['-prof -auto-all'])
test('T1988', normal, compile, ['']) test('T1988', normal, compile, [''])
test('T8467', normal, compile, ['']) test('T8467', normal, compile, [''])
test('T8037', normal, compile, ['']) test('T8037', normal, compile, [''])
test('T8743', extra_clean(['T8743.o-boot', 'T8743.hi-boot']), multimod_compile, ['T8743', '-v0']) test('T8743', [ extra_clean(['T8743.o-boot', 'T8743a.hi', 'T8743a.o', 'T8743.hi-boot']) ], multimod_compile, ['T8743', '-v0'])
test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, ['']) test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, [''])
# T9208 fails (and should do so) if you have assertion checking on in the compiler # T9208 fails (and should do so) if you have assertion checking on in the compiler
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module T3468 where module T3468 where
import {-# SOURCE #-} T3468 import T3468a
data Tool d = forall a r . F a data Tool d = forall a r . F a
module T3468a where
import {-# SOURCE #-} T3468
...@@ -215,7 +215,7 @@ test('T3950', normal, compile_fail, ['']) ...@@ -215,7 +215,7 @@ test('T3950', normal, compile_fail, [''])
test('T3966', normal, compile_fail, ['-O']) test('T3966', normal, compile_fail, ['-O'])
test('IPFail', normal, compile_fail, ['']) test('IPFail', normal, compile_fail, [''])
test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot']), test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot', 'T3468a.hi', 'T3468a.o']),
multimod_compile_fail, ['T3468', '-v0']) multimod_compile_fail, ['T3468', '-v0'])
test('T2846b', normal, compile_fail, ['']) test('T2846b', normal, compile_fail, [''])
test('FrozenErrorTests', normal, compile_fail, ['']) test('FrozenErrorTests', normal, compile_fail, [''])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment