diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-10-10 12:01:14 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-10-08 00:20:34 -0700 |
commit | 00b530d5402aaa37e4085ecdcae0ae54454736c1 (patch) | |
tree | 2d2963db4abdbcba9c12aea13a26e29e718e4778 /testsuite | |
parent | 887485a45ae55e81b26b6412b6f9dcf6a497f044 (diff) | |
download | haskell-00b530d5402aaa37e4085ecdcae0ae54454736c1.tar.gz |
The Backpack patch.
Summary:
This patch implements Backpack for GHC. It's a big patch but I've tried quite
hard to keep things, by-in-large, self-contained.
The user facing specification for Backpack can be found at:
https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst
A guide to the implementation can be found at:
https://github.com/ezyang/ghc-proposals/blob/backpack-impl/proposals/0000-backpack-impl.rst
Has a submodule update for Cabal, as well as a submodule update
for filepath to handle more strict checking of cabal-version.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, simonmar, bgamari, goldfire
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D1482
Diffstat (limited to 'testsuite')
233 files changed, 2818 insertions, 599 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 5e3f1c2cc4..2345ac49f2 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -102,6 +102,10 @@ mk/ghcconfig*_test___spaces_ghc*.exe.mk /tests/arrows/should_run/arrowrun002 /tests/arrows/should_run/arrowrun003 /tests/arrows/should_run/arrowrun004 +/tests/backpack/should_run/bkprun01 +/tests/backpack/should_run/bkprun02 +/tests/backpack/should_run/bkprun03 +/tests/backpack/should_run/bkprun04 /tests/boxy/T2193 /tests/cabal/1750.hs /tests/cabal/1750.out diff --git a/testsuite/driver/extra_files.py b/testsuite/driver/extra_files.py index b507826584..5918523a57 100644 --- a/testsuite/driver/extra_files.py +++ b/testsuite/driver/extra_files.py @@ -152,6 +152,8 @@ extra_src_files = { 'barton-mangler-bug': ['Basic.hs', 'Expected.hs', 'Main.hs', 'Physical.hs', 'Plot.lhs', 'PlotExample.lhs', 'TypesettingTricks.hs'], 'base01': ['GHC'], 'boolFormula': ['TestBoolFormula.hs'], + 'bkpcabal01': ['p', 'q', 'impl', 'bkpcabal01.cabal', 'Setup.hs', 'Main.hs'], + 'bkpcabal02': ['p', 'q', 'bkpcabal02.cabal', 'Setup.hs'], 'break001': ['../Test2.hs'], 'break002': ['../Test2.hs'], 'break003': ['../Test3.hs'], @@ -255,7 +257,7 @@ extra_src_files = { 'dynamicToo002': ['A.hs', 'B.hs', 'C.hs'], 'dynamicToo003': ['A003.hs'], 'dynamicToo004': ['Setup.hs', 'pkg1/', 'pkg1dyn/', 'pkg2/', 'prog.hs'], - 'dynamicToo005': ['A005.hsig'], + 'dynamicToo005': ['dynamicToo005.bkp'], 'dynamicToo006': ['A.hsig', 'B.hs'], 'dynamic_flags_001': ['A.hs', 'B.hs', 'C.hs'], 'dynamic_flags_002A': ['A_First.hs', 'A_Main.hs', 'A_Second.hs'], diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index b130b3c90e..9f37e1abfa 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -179,6 +179,9 @@ class TestOptions: self.ignore_stdout = False self.ignore_stderr = False + # Backpack test + self.compile_backpack = 0 + # We sometimes want to modify the compiler_always_flags, so # they are copied from config.compiler_always_flags when we # make a new instance of TestOptions. diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 595baabb3b..a39a2def5f 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -677,7 +677,7 @@ def get_package_cache_timestamp(): except: return 0.0 -do_not_copy = ('.hi', '.o', '.dyn_hi', '.dyn_o') # 12112 +do_not_copy = ('.hi', '.o', '.dyn_hi', '.dyn_o', '.out') # 12112 def test_common_work (name, opts, func, args): try: @@ -938,6 +938,21 @@ def compile( name, way, extra_hc_opts ): def compile_fail( name, way, extra_hc_opts ): return do_compile( name, way, 1, '', [], extra_hc_opts ) +def backpack_typecheck( name, way, extra_hc_opts ): + return do_compile( name, way, 0, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 ) + +def backpack_typecheck_fail( name, way, extra_hc_opts ): + return do_compile( name, way, 1, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 ) + +def backpack_compile( name, way, extra_hc_opts ): + return do_compile( name, way, 0, '', [], extra_hc_opts, backpack=1 ) + +def backpack_compile_fail( name, way, extra_hc_opts ): + return do_compile( name, way, 1, '', [], extra_hc_opts, backpack=1 ) + +def backpack_run( name, way, extra_hc_opts ): + return compile_and_run__( name, way, '', [], extra_hc_opts, backpack=1 ) + def multimod_compile( name, way, top_mod, extra_hc_opts ): return do_compile( name, way, 0, top_mod, [], extra_hc_opts ) @@ -950,7 +965,7 @@ def multi_compile( name, way, top_mod, extra_mods, extra_hc_opts ): def multi_compile_fail( name, way, top_mod, extra_mods, extra_hc_opts ): return do_compile( name, way, 1, top_mod, extra_mods, extra_hc_opts) -def do_compile(name, way, should_fail, top_mod, extra_mods, extra_hc_opts): +def do_compile(name, way, should_fail, top_mod, extra_mods, extra_hc_opts, **kwargs): # print 'Compile only, extra args = ', extra_hc_opts result = extras_build( way, extra_mods, extra_hc_opts ) @@ -958,7 +973,7 @@ def do_compile(name, way, should_fail, top_mod, extra_mods, extra_hc_opts): return result extra_hc_opts = result['hc_opts'] - result = simple_build(name, way, extra_hc_opts, should_fail, top_mod, 0, 1) + result = simple_build(name, way, extra_hc_opts, should_fail, top_mod, 0, 1, **kwargs) if badResult(result): return result @@ -1005,7 +1020,7 @@ def compile_cmp_asm( name, way, extra_hc_opts ): # ----------------------------------------------------------------------------- # Compile-and-run tests -def compile_and_run__( name, way, top_mod, extra_mods, extra_hc_opts ): +def compile_and_run__( name, way, top_mod, extra_mods, extra_hc_opts, backpack=0 ): # print 'Compile and run, extra args = ', extra_hc_opts result = extras_build( way, extra_mods, extra_hc_opts ) @@ -1016,7 +1031,7 @@ def compile_and_run__( name, way, top_mod, extra_mods, extra_hc_opts ): if way.startswith('ghci'): # interpreted... return interpreter_run(name, way, extra_hc_opts, top_mod) else: # compiled... - result = simple_build(name, way, extra_hc_opts, 0, top_mod, 1, 1) + result = simple_build(name, way, extra_hc_opts, 0, top_mod, 1, 1, backpack = backpack) if badResult(result): return result @@ -1102,7 +1117,7 @@ def extras_build( way, extra_mods, extra_hc_opts ): return {'passFail' : 'pass', 'hc_opts' : extra_hc_opts} -def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf): +def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, backpack = False): opts = getTestOpts() # Redirect stdout and stderr to the same file @@ -1112,7 +1127,10 @@ def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf): if top_mod != '': srcname = top_mod elif addsuf: - srcname = add_hs_lhs_suffix(name) + if backpack: + srcname = add_suffix(name, 'bkp') + else: + srcname = add_hs_lhs_suffix(name) else: srcname = name @@ -1120,6 +1138,12 @@ def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf): to_do = '--make ' if link: to_do = to_do + '-o ' + name + elif backpack: + if link: + to_do = '-o ' + name + ' ' + else: + to_do = '' + to_do = to_do + '--backpack ' elif link: to_do = '-o ' + name else: @@ -1128,6 +1152,8 @@ def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf): stats_file = name + '.comp.stats' if opts.compiler_stats_range_fields: extra_hc_opts += ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS' + if backpack: + extra_hc_opts += ' -outputdir ' + name + '.out' # Required by GHC 7.3+, harmless for earlier versions: if (getTestOpts().c_src or diff --git a/testsuite/tests/backpack/Makefile b/testsuite/tests/backpack/Makefile new file mode 100644 index 0000000000..9a36a1c5fe --- /dev/null +++ b/testsuite/tests/backpack/Makefile @@ -0,0 +1,3 @@ +TOP=../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/cabal/Makefile b/testsuite/tests/backpack/cabal/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/backpack/cabal/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/Main.hs b/testsuite/tests/backpack/cabal/bkpcabal01/Main.hs new file mode 100644 index 0000000000..4a96334c82 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/Main.hs @@ -0,0 +1,2 @@ +import Q +main = print out diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/Makefile b/testsuite/tests/backpack/cabal/bkpcabal01/Makefile new file mode 100644 index 0000000000..e67707f645 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/Makefile @@ -0,0 +1,71 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +SETUP=./Setup -v0 +CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=tmp.d --prefix='$(PWD)/inst' + +bkpcabal01: clean + $(MAKE) -s --no-print-directory clean + '$(GHC_PKG)' init tmp.d + '$(TEST_HC)' -v0 --make Setup + cp p/P.hs.in1 p/P.hs + cp q/Q.hs.in1 q/Q.hs + # typecheck p + $(CONFIGURE) --cid "p-0.1" p + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # build impl + $(CONFIGURE) --cid "impl-0.1" impl + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # typecheck q + $(CONFIGURE) --cid "q-0.1" q + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # build p + $(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H" + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # build q + $(CONFIGURE) --cid "q-0.1" q --instantiate-with "I=impl-0.1:I" + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # OK, now the crux of the test: recompilation. + cp p/P.hs.in2 p/P.hs + cp q/Q.hs.in2 q/Q.hs + # re-typecheck p + $(CONFIGURE) --cid "p-0.1" p + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # re-typecheck q (if buggy, this is what would fail) + $(CONFIGURE) --cid "q-0.1" q + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # re-build p + $(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H" + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # re-build q + $(CONFIGURE) --cid "q-0.1" q --instantiate-with "I=impl-0.1:I" + $(SETUP) build + $(SETUP) copy + $(SETUP) register + # build exe + $(CONFIGURE) --cid "exe-0.1" exe + $(SETUP) build + dist/build/exe/exe +ifneq "$(CLEANUP)" "" + $(MAKE) -s --no-print-directory clean +endif + +clean : + $(RM) -r tmp.d inst dist Setup$(exeext) diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs b/testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs new file mode 100644 index 0000000000..9a994af677 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/all.T b/testsuite/tests/backpack/cabal/bkpcabal01/all.T new file mode 100644 index 0000000000..1ee5ff18ad --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/all.T @@ -0,0 +1,9 @@ +if config.cleanup: + cleanup = 'CLEANUP=1' +else: + cleanup = 'CLEANUP=0' + +test('bkpcabal01', + normal, + run_command, + ['$MAKE -s --no-print-directory bkpcabal01 ' + cleanup]) diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.cabal b/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.cabal new file mode 100644 index 0000000000..1ffc575785 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.cabal @@ -0,0 +1,33 @@ +name: bkpcabal01 +version: 0.1.0.0 +license: BSD3 +author: Edward Z. Yang +maintainer: ezyang@cs.stanford.edu +build-type: Simple +cabal-version: >=1.25 + +library impl + exposed-modules: H, I + build-depends: base + hs-source-dirs: impl + default-language: Haskell2010 + +library p + exposed-modules: P + signatures: H + hs-source-dirs: p + build-depends: base + default-language: Haskell2010 + +library q + exposed-modules: Q + signatures: I + hs-source-dirs: q + build-depends: p, impl, base + backpack-includes: impl (H) + default-language: Haskell2010 + +executable exe + main-is: Main.hs + build-depends: base, q, impl + default-language: Haskell2010 diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.stdout b/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.stdout new file mode 100644 index 0000000000..0ca95142bb --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/bkpcabal01.stdout @@ -0,0 +1 @@ +True diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/impl/H.hs b/testsuite/tests/backpack/cabal/bkpcabal01/impl/H.hs new file mode 100644 index 0000000000..0644066ce8 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/impl/H.hs @@ -0,0 +1,2 @@ +module H where +x = True diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/impl/I.hs b/testsuite/tests/backpack/cabal/bkpcabal01/impl/I.hs new file mode 100644 index 0000000000..65d921950d --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/impl/I.hs @@ -0,0 +1 @@ +module I where diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/p/H.hsig b/testsuite/tests/backpack/cabal/bkpcabal01/p/H.hsig new file mode 100644 index 0000000000..85be31469a --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/p/H.hsig @@ -0,0 +1,2 @@ +signature H where +x :: Bool diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in1 b/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in1 new file mode 100644 index 0000000000..327a032132 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in1 @@ -0,0 +1,3 @@ +module P where +import H +y = x diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in2 b/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in2 new file mode 100644 index 0000000000..c776327517 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/p/P.hs.in2 @@ -0,0 +1,3 @@ +module P where +import H +z = x diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/q/I.hsig b/testsuite/tests/backpack/cabal/bkpcabal01/q/I.hsig new file mode 100644 index 0000000000..67d29b38ba --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/q/I.hsig @@ -0,0 +1 @@ +signature I where diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in1 b/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in1 new file mode 100644 index 0000000000..ada5c03dc5 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in1 @@ -0,0 +1,3 @@ +module Q where +import P +out = y diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in2 b/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in2 new file mode 100644 index 0000000000..011ed16d0c --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal01/q/Q.hs.in2 @@ -0,0 +1,3 @@ +module Q where +import P +out = z diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/Makefile b/testsuite/tests/backpack/cabal/bkpcabal02/Makefile new file mode 100644 index 0000000000..780102f881 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/Makefile @@ -0,0 +1,24 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +SETUP=./Setup -v0 +CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=tmp.d --prefix='$(PWD)/inst' + +bkpcabal02: clean + $(MAKE) -s --no-print-directory clean + '$(GHC_PKG)' init tmp.d + '$(TEST_HC)' -v0 --make Setup + cp p/H.hsig.in1 p/H.hsig + # typecheck everything + $(CONFIGURE) + $(SETUP) build + $(SETUP) -v1 build + cp p/H.hsig.in2 p/H.hsig + ! $(SETUP) build +ifneq "$(CLEANUP)" "" + $(MAKE) -s --no-print-directory clean +endif + +clean : + $(RM) -r tmp.d inst dist Setup$(exeext) diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/Setup.hs b/testsuite/tests/backpack/cabal/bkpcabal02/Setup.hs new file mode 100644 index 0000000000..9a994af677 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/all.T b/testsuite/tests/backpack/cabal/bkpcabal02/all.T new file mode 100644 index 0000000000..3d6f592805 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/all.T @@ -0,0 +1,9 @@ +if config.cleanup: + cleanup = 'CLEANUP=1' +else: + cleanup = 'CLEANUP=0' + +test('bkpcabal02', + normal, + run_command, + ['$MAKE -s --no-print-directory bkpcabal02 ' + cleanup]) diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.cabal b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.cabal new file mode 100644 index 0000000000..92ba58633a --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.cabal @@ -0,0 +1,19 @@ +name: bkpcabal01 +version: 0.1.0.0 +license: BSD3 +author: Edward Z. Yang +maintainer: ezyang@cs.stanford.edu +build-type: Simple +cabal-version: >=1.25 + +library p + signatures: H + hs-source-dirs: p + build-depends: base + default-language: Haskell2010 + +library q + signatures: H + hs-source-dirs: q + build-depends: p, base + default-language: Haskell2010 diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr new file mode 100644 index 0000000000..087365659c --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stderr @@ -0,0 +1,7 @@ + +q/H.hsig:2:1: error: + Identifier ‘x’ has conflicting definitions in the module + and its hsig file + Main module: x :: ghc-prim-0.5.0.0:GHC.Types.Int + Hsig file: x :: ghc-prim-0.5.0.0:GHC.Types.Bool + The two types are different diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stdout b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stdout new file mode 100644 index 0000000000..fb515ae4aa --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/bkpcabal02.stdout @@ -0,0 +1,4 @@ +Preprocessing library 'bkpcabal01-0.1.0.0-DwERz0Bcrkn4WeBnYMX11h-p' for +bkpcabal01-0.1.0.0... +Preprocessing library 'bkpcabal01-0.1.0.0-DwERz0Bcrkn4WeBnYMX11h-q' for +bkpcabal01-0.1.0.0... diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/p/.gitignore b/testsuite/tests/backpack/cabal/bkpcabal02/p/.gitignore new file mode 100644 index 0000000000..e1f5114917 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/p/.gitignore @@ -0,0 +1 @@ +H.hsig diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in1 b/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in1 new file mode 100644 index 0000000000..7b101601a7 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in1 @@ -0,0 +1,2 @@ +signature H where +x :: Int diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in2 b/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in2 new file mode 100644 index 0000000000..85be31469a --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/p/H.hsig.in2 @@ -0,0 +1,2 @@ +signature H where +x :: Bool diff --git a/testsuite/tests/backpack/cabal/bkpcabal02/q/H.hsig b/testsuite/tests/backpack/cabal/bkpcabal02/q/H.hsig new file mode 100644 index 0000000000..7b101601a7 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal02/q/H.hsig @@ -0,0 +1,2 @@ +signature H where +x :: Int diff --git a/testsuite/tests/backpack/reexport/Makefile b/testsuite/tests/backpack/reexport/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/backpack/reexport/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/reexport/all.T b/testsuite/tests/backpack/reexport/all.T new file mode 100644 index 0000000000..55a5004571 --- /dev/null +++ b/testsuite/tests/backpack/reexport/all.T @@ -0,0 +1,7 @@ +test('bkpreex01', normal, backpack_typecheck, ['']) +test('bkpreex02', normal, backpack_typecheck, ['']) +test('bkpreex03', normal, backpack_typecheck, ['']) +test('bkpreex04', normal, backpack_typecheck, ['']) +# These signatures are behaving badly and the renamer gets confused +test('bkpreex05', expect_broken(0), backpack_typecheck, ['']) +test('bkpreex06', normal, backpack_typecheck, ['']) diff --git a/testsuite/tests/backpack/reexport/bkpreex01.bkp b/testsuite/tests/backpack/reexport/bkpreex01.bkp new file mode 100644 index 0000000000..fa6c36a4d1 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex01.bkp @@ -0,0 +1,13 @@ +unit h where + signature H(T) where + data T +unit p where + dependency h[H=<H>] + module B(T(..)) where + data T = T + signature H(T(..), f) where + import B(T(..)) + f :: a -> a + module A(T) where + import H(T(T),f) + x = f T :: T diff --git a/testsuite/tests/backpack/reexport/bkpreex01.stderr b/testsuite/tests/backpack/reexport/bkpreex01.stderr new file mode 100644 index 0000000000..ac80b79800 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex01.stderr @@ -0,0 +1,6 @@ +[1 of 2] Processing h + [1 of 1] Compiling H[sig] ( h/H.hsig, nothing ) +[2 of 2] Processing p + [1 of 3] Compiling B ( p/B.hs, nothing ) + [2 of 3] Compiling H[sig] ( p/H.hsig, nothing ) + [3 of 3] Compiling A ( p/A.hs, nothing ) diff --git a/testsuite/tests/backpack/reexport/bkpreex02.bkp b/testsuite/tests/backpack/reexport/bkpreex02.bkp new file mode 100644 index 0000000000..0224b110ce --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex02.bkp @@ -0,0 +1,27 @@ +unit p where + signature T where + data T + signature H where + import T + f :: T -> T +unit timpl where + module TImpl where + data T = T +unit q where + dependency timpl + dependency p[H=<H>,T=<T>] + signature T(T) where + import TImpl + module A where + import H + import TImpl + x = f T +unit r-impl where + dependency timpl + module H where + import TImpl + f T = T + module T(T) where + import TImpl +unit r where + dependency q[H=r-impl:H,T=r-impl:T] diff --git a/testsuite/tests/backpack/reexport/bkpreex02.stderr b/testsuite/tests/backpack/reexport/bkpreex02.stderr new file mode 100644 index 0000000000..44c07c44ff --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex02.stderr @@ -0,0 +1,27 @@ +[1 of 5] Processing p + [1 of 2] Compiling T[sig] ( p/T.hsig, nothing ) + [2 of 2] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 5] Processing timpl + Instantiating timpl + [1 of 1] Compiling TImpl ( timpl/TImpl.hs, nothing ) +[3 of 5] Processing q + [1 of 3] Compiling T[sig] ( q/T.hsig, nothing ) + [2 of 3] Compiling H[sig] ( q/H.hsig, nothing ) + [3 of 3] Compiling A ( q/A.hs, nothing ) +[4 of 5] Processing r-impl + Instantiating r-impl + [1 of 1] Including timpl + [1 of 2] Compiling H ( r-impl/H.hs, nothing ) + [2 of 2] Compiling T ( r-impl/T.hs, nothing ) +[5 of 5] Processing r + Instantiating r + [1 of 1] Including q[H=r-impl:H, T=r-impl:T] + Instantiating q[H=r-impl:H, T=r-impl:T] + [1 of 2] Including timpl + [2 of 2] Including p[H=r-impl:H, T=r-impl:T] + Instantiating p[H=r-impl:H, T=r-impl:T] + [1 of 2] Compiling T[sig] ( p/T.hsig, nothing ) + [2 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [1 of 3] Compiling T[sig] ( q/T.hsig, nothing ) + [2 of 3] Compiling H[sig] ( q/H.hsig, nothing ) + [3 of 3] Compiling A ( q/A.hs, nothing ) diff --git a/testsuite/tests/backpack/reexport/bkpreex03.bkp b/testsuite/tests/backpack/reexport/bkpreex03.bkp new file mode 100644 index 0000000000..69c2f55fce --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex03.bkp @@ -0,0 +1,9 @@ +unit p where + module M1 where + data M = M + module M2 where + data M = M + signature A(M) where + import M1 + signature A(M) where + import M2 diff --git a/testsuite/tests/backpack/reexport/bkpreex03.stderr b/testsuite/tests/backpack/reexport/bkpreex03.stderr new file mode 100644 index 0000000000..7d900da7d2 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex03.stderr @@ -0,0 +1,5 @@ +[1 of 1] Processing p + [1 of 4] Compiling M1 ( p/M1.hs, nothing ) + [2 of 4] Compiling M2 ( p/M2.hs, nothing ) + [3 of 4] Compiling A[sig] ( p/A.hsig, nothing ) + [4 of 4] Compiling A[sig] ( p/A.hsig, nothing ) diff --git a/testsuite/tests/backpack/reexport/bkpreex04.bkp b/testsuite/tests/backpack/reexport/bkpreex04.bkp new file mode 100644 index 0000000000..610ebd90f3 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex04.bkp @@ -0,0 +1,7 @@ +unit p where + signature A where + data T + signature B where + data T + signature A(T) where + import B(T) diff --git a/testsuite/tests/backpack/reexport/bkpreex04.stderr b/testsuite/tests/backpack/reexport/bkpreex04.stderr new file mode 100644 index 0000000000..a21cf89027 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex04.stderr @@ -0,0 +1,4 @@ +[1 of 1] Processing p + [1 of 3] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( p/B.hsig, nothing ) + [3 of 3] Compiling A[sig] ( p/A.hsig, nothing ) diff --git a/testsuite/tests/backpack/reexport/bkpreex05.bkp b/testsuite/tests/backpack/reexport/bkpreex05.bkp new file mode 100644 index 0000000000..e496ed76fa --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex05.bkp @@ -0,0 +1,28 @@ +unit bar where + signature A(bar) where + data A = A { foo :: Int, bar :: Bool } + +unit foo where + signature A(foo) where + data A = A { foo :: Int, bar :: Bool } + +unit impl where + module A1 where + data A = A { foo :: Int, bar :: Bool } + module A2 where + data A = A { foo :: Int, bar :: Bool } + module A(foo, bar) where + import A1(foo) + import A2(bar) + +-- Kind of boring test now haha + +unit barimpl where + dependency bar[A=impl:A] + +unit fooimpl where + dependency foo[A=impl:A] + +unit foobarimpl where + dependency foo[A=impl:A] + dependency bar[A=impl:A] diff --git a/testsuite/tests/backpack/reexport/bkpreex06.bkp b/testsuite/tests/backpack/reexport/bkpreex06.bkp new file mode 100644 index 0000000000..2c04b61a38 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex06.bkp @@ -0,0 +1,11 @@ +unit p where + signature A1 where + data A = A { foo :: Int, bar :: Bool } + signature A2(foo) where + import A1(foo) +unit q where + signature A2 where + data A = A { foo :: Int, bar :: Bool } +unit r where + dependency p[A1=<A1>,A2=<A2>] + dependency q[A2=<A2>] diff --git a/testsuite/tests/backpack/reexport/bkpreex06.stderr b/testsuite/tests/backpack/reexport/bkpreex06.stderr new file mode 100644 index 0000000000..225a8aacc8 --- /dev/null +++ b/testsuite/tests/backpack/reexport/bkpreex06.stderr @@ -0,0 +1,8 @@ +[1 of 3] Processing p + [1 of 2] Compiling A1[sig] ( p/A1.hsig, nothing ) + [2 of 2] Compiling A2[sig] ( p/A2.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A2[sig] ( q/A2.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling A1[sig] ( r/A1.hsig, nothing ) + [2 of 2] Compiling A2[sig] ( r/A2.hsig, nothing ) diff --git a/testsuite/tests/backpack/should_compile/Makefile b/testsuite/tests/backpack/should_compile/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/backpack/should_compile/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/should_compile/all.T b/testsuite/tests/backpack/should_compile/all.T new file mode 100644 index 0000000000..3ad6538831 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/all.T @@ -0,0 +1,31 @@ +test('bkp01', normal, backpack_compile, ['-O']) +test('bkp02', normal, backpack_compile, ['']) +test('bkp07', normal, backpack_compile, ['']) +test('bkp08', normal, backpack_compile, ['']) +test('bkp09', normal, backpack_compile, ['']) +test('bkp10', normal, backpack_compile, ['']) +test('bkp11', normal, backpack_compile, ['']) +test('bkp12', normal, backpack_compile, ['']) +test('bkp14', normal, backpack_compile, ['']) +test('bkp15', normal, backpack_compile, ['']) +test('bkp16', normal, backpack_compile, ['']) +test('bkp17', normal, backpack_compile, ['']) +test('bkp18', normal, backpack_compile, ['']) +test('bkp19', normal, backpack_compile, ['']) +test('bkp20', normal, backpack_compile, ['']) +test('bkp21', normal, backpack_compile, ['']) +test('bkp23', normal, backpack_compile, ['']) +test('bkp24', normal, backpack_compile, ['']) +test('bkp25', normal, backpack_compile, ['']) +test('bkp26', normal, backpack_compile, ['']) +test('bkp27', normal, backpack_compile, ['']) +test('bkp28', normal, backpack_compile, ['']) +test('bkp29', normal, backpack_compile, ['']) +test('bkp30', normal, backpack_compile, ['']) +test('bkp31', normal, backpack_compile, ['']) +test('bkp32', normal, backpack_compile, ['']) +test('bkp33', normal, backpack_compile, ['']) +test('bkp34', normal, backpack_compile, ['']) +# instance merging when heads overlap prefers an arbitrary instance +test('bkp35', expect_broken(0), backpack_compile, ['']) +test('bkp36', normal, backpack_compile, ['']) diff --git a/testsuite/tests/backpack/should_compile/bkp01.bkp b/testsuite/tests/backpack/should_compile/bkp01.bkp new file mode 100644 index 0000000000..2f5d0080a1 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp01.bkp @@ -0,0 +1,20 @@ +unit p where + signature H where + data T + x :: Bool + module A where + import H + data A = MkA T + y = x + +unit q where + dependency p[H=<H>] + +unit h where + module H where + data T = T + x = True + +unit r where + dependency h + dependency q[H=h:H] diff --git a/testsuite/tests/backpack/should_compile/bkp01.stderr b/testsuite/tests/backpack/should_compile/bkp01.stderr new file mode 100644 index 0000000000..51cc4b7cdd --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp01.stderr @@ -0,0 +1,18 @@ +[1 of 4] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 4] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 4] Processing h + Instantiating h + [1 of 1] Compiling H ( h/H.hs, bkp01.out/h/H.o ) +[4 of 4] Processing r + Instantiating r + [1 of 2] Including h + [2 of 2] Including q[H=h:H] + Instantiating q[H=h:H] + [1 of 1] Including p[H=h:H] + Instantiating p[H=h:H] + [1 of 2] Compiling H[sig] ( p/H.hsig, bkp01.out/p/p-6KeuBvYi0jvLWqVbkSAZMq/H.o ) + [2 of 2] Compiling A ( p/A.hs, bkp01.out/p/p-6KeuBvYi0jvLWqVbkSAZMq/A.o ) + [1 of 1] Compiling H[sig] ( q/H.hsig, bkp01.out/q/q-6KeuBvYi0jvLWqVbkSAZMq/H.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp01.stdout b/testsuite/tests/backpack/should_compile/bkp01.stdout new file mode 100644 index 0000000000..e72d7bc43c --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp01.stdout @@ -0,0 +1,20 @@ +Shape for p-impls +provides: P -> p-impls():P + hello + Q -> p-impls():Q + p-impls():P.hello, world +requires: +==== Package p-impls ==== +[1 of 2] Compiling P ( p-impls/P.hs, nothing ) +[2 of 2] Compiling Q ( p-impls/Q.hs, nothing ) +Shape for q +provides: P -> p-impls():P + hello + Q -> p-impls():Q + p-impls():P.hello, world + Main -> q():Main + main +requires: +==== Package q ==== +[1 of 2] Including p-impls +[2 of 2] Compiling Main ( q/Main.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp01c.stdout b/testsuite/tests/backpack/should_compile/bkp01c.stdout new file mode 100644 index 0000000000..63e393d4bb --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp01c.stdout @@ -0,0 +1,18 @@ +[1 of 4] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 4] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 4] Processing h + Instantiating h + [1 of 1] Compiling H ( h/H.hs, bkp01c/h/H.o ) +[4 of 4] Processing r + Instantiating r + [1 of 2] Including h + [2 of 2] Including q + Instantiating q[H=h:H] + [1 of 1] Including p + Instantiating p[H=h:H] + [1 of 2] Compiling H[sig] ( p/H.hsig, bkp01c/p/p-6KeuBvYi0jvLWqVbkSAZMq/H.o ) + [2 of 2] Compiling A ( p/A.hs, bkp01c/p/p-6KeuBvYi0jvLWqVbkSAZMq/A.o ) + [1 of 1] Compiling H[sig] ( q/H.hsig, bkp01c/q/q-6KeuBvYi0jvLWqVbkSAZMq/H.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp02.bkp b/testsuite/tests/backpack/should_compile/bkp02.bkp new file mode 100644 index 0000000000..a5e0ff7fe0 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp02.bkp @@ -0,0 +1,18 @@ +unit p where + signature H where + data T + module A where + import H + data A = MkA T + +unit q where + module H where + data T = T + +unit r where + dependency q + dependency p[H=q:H] + module R where + import A + import H + x = MkA T diff --git a/testsuite/tests/backpack/should_compile/bkp02.stderr b/testsuite/tests/backpack/should_compile/bkp02.stderr new file mode 100644 index 0000000000..ace97e4b63 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp02.stderr @@ -0,0 +1,14 @@ +[1 of 3] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling H ( q/H.hs, bkp02.out/q/H.o ) +[3 of 3] Processing r + Instantiating r + [1 of 2] Including q + [2 of 2] Including p[H=q:H] + Instantiating p[H=q:H] + [1 of 2] Compiling H[sig] ( p/H.hsig, bkp02.out/p/p-D5Mg3foBSCrDbQDKH4WGSG/H.o ) + [2 of 2] Compiling A ( p/A.hs, bkp02.out/p/p-D5Mg3foBSCrDbQDKH4WGSG/A.o ) + [1 of 1] Compiling R ( r/R.hs, bkp02.out/r/R.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp02.stdout b/testsuite/tests/backpack/should_compile/bkp02.stdout new file mode 100644 index 0000000000..4abb444372 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp02.stdout @@ -0,0 +1,26 @@ +Shape for p +provides: A -> p(H -> hole:H):A + A{A, MkA} +requires: H -> hole:H + T{T} +==== Package p ==== +[1 of 2] Compiling H[abstract sig] ( p/H.hsig, nothing ) +[2 of 2] Compiling A ( p/A.hs, nothing ) +Shape for q +provides: H -> q():H + T{T, T} +requires: +==== Package q ==== +[1 of 1] Compiling H ( q/H.hs, nothing ) +Shape for r +provides: H -> q():H + T{T, T} + A -> p(H -> q():H):A + A{A, MkA} + R -> r():R + x +requires: +==== Package r ==== +[1 of 3] Including q +[2 of 3] Including p +[3 of 3] Compiling R ( r/R.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp03.stderr b/testsuite/tests/backpack/should_compile/bkp03.stderr new file mode 100644 index 0000000000..a1a4eb150d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp03.stderr @@ -0,0 +1,25 @@ +[1 of 2] Processing q +/--- Shape for q +provides: T -> q(hole:X, hole:H):T + hole:X.X{X, X}, T{T, T} +requires: X -> X{X, X} + H -> q(hole:X, hole:H):T.T{T, T}, f +\--- + [1 of 3] Compiling X[sig] ( q/X.hsig, nothing ) + [2 of 3] Compiling T ( q/T.hs, nothing ) + [3 of 3] Compiling H[sig] ( q/H.hsig, nothing ) +[2 of 2] Processing p +/--- Shape for p +provides: T -> q(hole:X, hole:H):T + p(hole:X, hole:H):XImpl.X{X, X}, T{T, T} + XImpl -> p(hole:X, hole:H):XImpl + X{X, X} + A -> p(hole:X, hole:H):A + q(hole:X, hole:H):T.T{T} +requires: X -> p(hole:X, hole:H):XImpl.X{X, X} + H -> q(hole:X, hole:H):T.T{T, T}, f +\--- + [1 of 4] Compiling XImpl ( p/XImpl.hs, nothing ) + [2 of 4] Compiling X[sig] ( p/X.hsig, nothing ) + [3 of 4] Compiling H[sig] ( p/H.hsig, nothing ) + [4 of 4] Compiling A ( p/A.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp04.stderr b/testsuite/tests/backpack/should_compile/bkp04.stderr new file mode 100644 index 0000000000..a21cf89027 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp04.stderr @@ -0,0 +1,4 @@ +[1 of 1] Processing p + [1 of 3] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( p/B.hsig, nothing ) + [3 of 3] Compiling A[sig] ( p/A.hsig, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp05.stderr b/testsuite/tests/backpack/should_compile/bkp05.stderr new file mode 100644 index 0000000000..b0102081bd --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp05.stderr @@ -0,0 +1,19 @@ +[1 of 6] Processing bar + [1 of 1] Compiling A[sig] ( bar/A.hsig, nothing ) +[2 of 6] Processing foo + [1 of 1] Compiling A[sig] ( foo/A.hsig, nothing ) +[3 of 6] Processing impl + Instantiating impl + [1 of 3] Compiling A1 ( impl/A1.hs, bkp05-out/impl/A1.o ) + [2 of 3] Compiling A2 ( impl/A2.hs, bkp05-out/impl/A2.o ) + [3 of 3] Compiling A ( impl/A.hs, bkp05-out/impl/A.o ) +[4 of 6] Processing barimpl + Instantiating barimpl + [1 of 2] Including impl + [2 of 2] Including bar + Instantiating bar(impl:A) + [1 of 1] Compiling A[sig] ( bar/A.hsig, nothing ) + +bkp05.bkp:2:5: error: Not in scope: type constructor or class ‘A’ + +bkp05.bkp:2:5: error: Not in scope: data constructor ‘A’ diff --git a/testsuite/tests/backpack/should_compile/bkp06.stderr b/testsuite/tests/backpack/should_compile/bkp06.stderr new file mode 100644 index 0000000000..225a8aacc8 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp06.stderr @@ -0,0 +1,8 @@ +[1 of 3] Processing p + [1 of 2] Compiling A1[sig] ( p/A1.hsig, nothing ) + [2 of 2] Compiling A2[sig] ( p/A2.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A2[sig] ( q/A2.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling A1[sig] ( r/A1.hsig, nothing ) + [2 of 2] Compiling A2[sig] ( r/A2.hsig, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp07.bkp b/testsuite/tests/backpack/should_compile/bkp07.bkp new file mode 100644 index 0000000000..918ff08e28 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp07.bkp @@ -0,0 +1,9 @@ +unit p where + signature A where + foo :: a -> a + +unit q where + dependency p[A=<A>] + module B where + import A + bar x = foo (x + x) diff --git a/testsuite/tests/backpack/should_compile/bkp07.stderr b/testsuite/tests/backpack/should_compile/bkp07.stderr new file mode 100644 index 0000000000..2ccfaac56a --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp07.stderr @@ -0,0 +1,5 @@ +[1 of 2] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 2] Processing q + [1 of 2] Compiling A[sig] ( q/A.hsig, nothing ) + [2 of 2] Compiling B ( q/B.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp08.bkp b/testsuite/tests/backpack/should_compile/bkp08.bkp new file mode 100644 index 0000000000..799ea5753d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp08.bkp @@ -0,0 +1,12 @@ +unit q where + module H where + data T = T { x :: Bool } +unit r where + signature H where + data T +unit p where + dependency q + dependency r[H=q:H] + module M where + import H + f = T True diff --git a/testsuite/tests/backpack/should_compile/bkp08.stderr b/testsuite/tests/backpack/should_compile/bkp08.stderr new file mode 100644 index 0000000000..e81e013bc1 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp08.stderr @@ -0,0 +1,12 @@ +[1 of 3] Processing q + Instantiating q + [1 of 1] Compiling H ( q/H.hs, bkp08.out/q/H.o ) +[2 of 3] Processing r + [1 of 1] Compiling H[sig] ( r/H.hsig, nothing ) +[3 of 3] Processing p + Instantiating p + [1 of 2] Including q + [2 of 2] Including r[H=q:H] + Instantiating r[H=q:H] + [1 of 1] Compiling H[sig] ( r/H.hsig, bkp08.out/r/r-D5Mg3foBSCrDbQDKH4WGSG/H.o ) + [1 of 1] Compiling M ( p/M.hs, bkp08.out/p/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp09.bkp b/testsuite/tests/backpack/should_compile/bkp09.bkp new file mode 100644 index 0000000000..64cf447715 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp09.bkp @@ -0,0 +1,30 @@ +{-# LANGUAGE RankNTypes, DatatypeContexts, CApiFFI, GADTs, TypeFamilies, DefaultSignatures, MultiParamTypeClasses, FunctionalDependencies, PatternSynonyms #-} + +-- Reflexivity test, bang on the units with as much +-- stuff as we can. +unit p where + signature H where + data T a = MkT (S a) + data S a = MkS a + +-- keept his synced up! +unit q where + signature H where + data T a = MkT (S a) + data S a = MkS a + +unit r where + dependency p[H=<H>] + dependency q[H=<H>] + module M where + import H + x = MkT (MkS True) + +unit h-impl where + module H where + data T a = MkT (S a) + data S a = MkS a + +unit s where + dependency h-impl + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp09.stderr b/testsuite/tests/backpack/should_compile/bkp09.stderr new file mode 100644 index 0000000000..24abba259f --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp09.stderr @@ -0,0 +1,26 @@ + +bkp09.bkp:1:26: warning: + -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. +[1 of 5] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 5] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 5] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[4 of 5] Processing h-impl + Instantiating h-impl + [1 of 1] Compiling H ( h-impl/H.hs, bkp09.out/h-impl/H.o ) +[5 of 5] Processing s + Instantiating s + [1 of 2] Including h-impl + [2 of 2] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 2] Including p[H=h-impl:H] + Instantiating p[H=h-impl:H] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkp09.out/p/p-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Including q[H=h-impl:H] + Instantiating q[H=h-impl:H] + [1 of 1] Compiling H[sig] ( q/H.hsig, bkp09.out/q/q-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp09.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp09.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp10.bkp b/testsuite/tests/backpack/should_compile/bkp10.bkp new file mode 100644 index 0000000000..851dd401aa --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp10.bkp @@ -0,0 +1,13 @@ +unit p where + signature H where + data S + module A where + import H + data T = T S + +unit q where + dependency p[H=<H2>] (A as A2) + module B where + import A2 + import H2 + t = T :: S -> T diff --git a/testsuite/tests/backpack/should_compile/bkp10.stderr b/testsuite/tests/backpack/should_compile/bkp10.stderr new file mode 100644 index 0000000000..350670e6d4 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp10.stderr @@ -0,0 +1,6 @@ +[1 of 2] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 2] Processing q + [1 of 2] Compiling H2[sig] ( q/H2.hsig, nothing ) + [2 of 2] Compiling B ( q/B.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp11.bkp b/testsuite/tests/backpack/should_compile/bkp11.bkp new file mode 100644 index 0000000000..30792f76bc --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp11.bkp @@ -0,0 +1,17 @@ +unit p where + signature H where + data S + signature H2 where + data T + module A where + import H + import H2 + data Z = Z S T + +unit q where + dependency p[H=<H>, H2=<H>] + module B where + import H + import A + f :: S -> T -> Z + f = Z diff --git a/testsuite/tests/backpack/should_compile/bkp11.stderr b/testsuite/tests/backpack/should_compile/bkp11.stderr new file mode 100644 index 0000000000..a804563b2d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp11.stderr @@ -0,0 +1,7 @@ +[1 of 2] Processing p + [1 of 3] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 3] Compiling H2[sig] ( p/H2.hsig, nothing ) + [3 of 3] Compiling A ( p/A.hs, nothing ) +[2 of 2] Processing q + [1 of 2] Compiling H[sig] ( q/H.hsig, nothing ) + [2 of 2] Compiling B ( q/B.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp12.bkp b/testsuite/tests/backpack/should_compile/bkp12.bkp new file mode 100644 index 0000000000..a62f184d5b --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp12.bkp @@ -0,0 +1,15 @@ +-- this is a simplified version of bkp09 +unit p where + signature H where + x :: Bool +unit r where + dependency p[H=<H>] + module M where + import H + a = x +unit h-impl where + module H where + x = True +unit s where + dependency h-impl + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp12.stderr b/testsuite/tests/backpack/should_compile/bkp12.stderr new file mode 100644 index 0000000000..dc4debe3f3 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp12.stderr @@ -0,0 +1,18 @@ +[1 of 4] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 4] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[3 of 4] Processing h-impl + Instantiating h-impl + [1 of 1] Compiling H ( h-impl/H.hs, bkp12.out/h-impl/H.o ) +[4 of 4] Processing s + Instantiating s + [1 of 2] Including h-impl + [2 of 2] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 1] Including p[H=h-impl:H] + Instantiating p[H=h-impl:H] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkp12.out/p/p-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp12.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp12.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp13.stderr b/testsuite/tests/backpack/should_compile/bkp13.stderr new file mode 100644 index 0000000000..ac80b79800 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp13.stderr @@ -0,0 +1,6 @@ +[1 of 2] Processing h + [1 of 1] Compiling H[sig] ( h/H.hsig, nothing ) +[2 of 2] Processing p + [1 of 3] Compiling B ( p/B.hs, nothing ) + [2 of 3] Compiling H[sig] ( p/H.hsig, nothing ) + [3 of 3] Compiling A ( p/A.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp14.bkp b/testsuite/tests/backpack/should_compile/bkp14.bkp new file mode 100644 index 0000000000..7d6f9e1455 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp14.bkp @@ -0,0 +1,23 @@ +unit p where + signature H where + data T + f :: T + signature Y where + data Y + module M where + import H + x = f +unit impl where + module F where + data T = T + deriving (Show) + f = T + module H(T, f) where + import F +unit q where + dependency impl + dependency p[H=impl:H, Y=<Y>] + module X where + import M + import H + main = print (x :: T) diff --git a/testsuite/tests/backpack/should_compile/bkp14.stderr b/testsuite/tests/backpack/should_compile/bkp14.stderr new file mode 100644 index 0000000000..b5b40b7eff --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp14.stderr @@ -0,0 +1,11 @@ +[1 of 3] Processing p + [1 of 3] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 3] Compiling Y[sig] ( p/Y.hsig, nothing ) + [3 of 3] Compiling M ( p/M.hs, nothing ) +[2 of 3] Processing impl + Instantiating impl + [1 of 2] Compiling F ( impl/F.hs, bkp14.out/impl/F.o ) + [2 of 2] Compiling H ( impl/H.hs, bkp14.out/impl/H.o ) +[3 of 3] Processing q + [1 of 2] Compiling Y[sig] ( q/Y.hsig, nothing ) + [2 of 2] Compiling X ( q/X.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp15.bkp b/testsuite/tests/backpack/should_compile/bkp15.bkp new file mode 100644 index 0000000000..6eb5364139 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp15.bkp @@ -0,0 +1,82 @@ +{-# LANGUAGE RankNTypes, DatatypeContexts, CApiFFI, GADTs, TypeFamilies, DefaultSignatures, MultiParamTypeClasses, FunctionalDependencies, PatternSynonyms #-} + +-- Reflexivity test, bang on the units with as much +-- stuff as we can. +unit p where + signature H where + x :: (forall a. a -> a) -> (Int, Bool) + data Eq a => T a = T (a -> a) | S (S a) + data S a = R (T a) + data {-# CTYPE "Foo" #-} Foo where + Foo :: Foo + newtype F a = F a + type X m a = m a + type family Elem c + class Eq a => Bloop a b | a -> b where + data GMap a (v :: * -> *) :: * + xa :: a -> a -> Bool + xa = (==) + y :: a -> a -> Ordering + default y :: Ord a => a -> a -> Ordering + y = compare + {-# MINIMAL xa | y #-} + -- type instance Elem Int = Bool + -- pattern Blub n = ("foo", n) + +-- keept his synced up! +unit q where + signature H where + x :: (forall a. a -> a) -> (Int, Bool) + data Eq a => T a = T (a -> a) | S (S a) + data S a = R (T a) + data {-# CTYPE "Foo" #-} Foo where + Foo :: Foo + newtype F a = F a + type X m a = m a + type family Elem c + class Eq a => Bloop a b | a -> b where + data GMap a (v :: * -> *) :: * + xa :: a -> a -> Bool + xa = (==) + y :: a -> a -> Ordering + default y :: Ord a => a -> a -> Ordering + y = compare + {-# MINIMAL xa | y #-} + -- type instance Elem Int = Bool + -- pattern Blub n = ("foo", n) + +unit r where + dependency p[H=<H>] + dependency q[H=<H>] + module M where + import H + a = x id + b = T (id :: String -> String) + c = S (R b) + d = F Foo :: X F Foo + type instance Elem Bool = Int + instance Bloop Bool Bool where + data GMap Bool v = GMapBool (v Bool) + xa a b = a == not b + +unit h-impl where + module H where + x :: (forall a. a -> a) -> (Int, Bool) + x f = (f 2, f True) + data Eq a => T a = T (a -> a) | S (S a) + data S a = R (T a) + data {-# CTYPE "Foo" #-} Foo where + Foo :: Foo + newtype F a = F a + type X m a = m a + type family Elem c + class Eq a => Bloop a b | a -> b where + data GMap a (v :: * -> *) :: * + xa :: a -> a -> Bool + xa = (==) + y :: a -> a -> Ordering + default y :: Ord a => a -> a -> Ordering + y = compare + {-# MINIMAL xa | y #-} +unit s where + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp15.stderr b/testsuite/tests/backpack/should_compile/bkp15.stderr new file mode 100644 index 0000000000..904ab2d4cb --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp15.stderr @@ -0,0 +1,25 @@ + +bkp15.bkp:1:26: warning: + -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. +[1 of 5] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 5] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 5] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[4 of 5] Processing h-impl + Instantiating h-impl + [1 of 1] Compiling H ( h-impl/H.hs, bkp15.out/h-impl/H.o ) +[5 of 5] Processing s + Instantiating s + [1 of 1] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 2] Including p[H=h-impl:H] + Instantiating p[H=h-impl:H] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkp15.out/p/p-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Including q[H=h-impl:H] + Instantiating q[H=h-impl:H] + [1 of 1] Compiling H[sig] ( q/H.hsig, bkp15.out/q/q-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp15.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp15.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp16.bkp b/testsuite/tests/backpack/should_compile/bkp16.bkp new file mode 100644 index 0000000000..f1a161e53c --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp16.bkp @@ -0,0 +1,8 @@ +{-# LANGUAGE MagicHash #-} +unit p where + dependency ghc-prim + signature Int where + import GHC.Prim + data Int = I# Int# +unit q where + dependency p[Int=base:GHC.Exts] diff --git a/testsuite/tests/backpack/should_compile/bkp16.stderr b/testsuite/tests/backpack/should_compile/bkp16.stderr new file mode 100644 index 0000000000..f35021fe11 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp16.stderr @@ -0,0 +1,8 @@ +[1 of 2] Processing p + [1 of 1] Compiling Int[sig] ( p/Int.hsig, nothing ) +[2 of 2] Processing q + Instantiating q + [1 of 1] Including p[Int=base-4.9.0.0:GHC.Exts] + Instantiating p[Int=base-4.9.0.0:GHC.Exts] + [1 of 1] Including ghc-prim-0.5.0.0 + [1 of 1] Compiling Int[sig] ( p/Int.hsig, bkp16.out/p/p-97PZnzqiJmd2hTwUNGdjod/Int.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp17.bkp b/testsuite/tests/backpack/should_compile/bkp17.bkp new file mode 100644 index 0000000000..a2a9fcfc41 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp17.bkp @@ -0,0 +1,6 @@ +unit p where + signature H where +unit q where + module M where +unit r where + dependency p[H=q:M] diff --git a/testsuite/tests/backpack/should_compile/bkp17.stderr b/testsuite/tests/backpack/should_compile/bkp17.stderr new file mode 100644 index 0000000000..a52394dcaf --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp17.stderr @@ -0,0 +1,10 @@ +[1 of 3] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling M ( q/M.hs, bkp17.out/q/M.o ) +[3 of 3] Processing r + Instantiating r + [1 of 1] Including p[H=q:M] + Instantiating p[H=q:M] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkp17.out/p/p-Bk81HcBu6NbDb1eswyn055/H.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp18.bkp b/testsuite/tests/backpack/should_compile/bkp18.bkp new file mode 100644 index 0000000000..db8bf262b7 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp18.bkp @@ -0,0 +1,18 @@ +unit r where + signature H where + data Foo = Foo + -- NB: Foo here gets compiled into Foo{v} on the RHS, referring + -- to the DataCon wrapper! + -- (There should be a test for type class too) + module M where + import H + d = Foo + +unit h-impl where + module A where + data Foo = Foo + module H(Foo(..)) where + import A + +unit s where + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp18.stderr b/testsuite/tests/backpack/should_compile/bkp18.stderr new file mode 100644 index 0000000000..e14b99431c --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp18.stderr @@ -0,0 +1,13 @@ +[1 of 3] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[2 of 3] Processing h-impl + Instantiating h-impl + [1 of 2] Compiling A ( h-impl/A.hs, bkp18.out/h-impl/A.o ) + [2 of 2] Compiling H ( h-impl/H.hs, bkp18.out/h-impl/H.o ) +[3 of 3] Processing s + Instantiating s + [1 of 1] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp18.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp18.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp19.bkp b/testsuite/tests/backpack/should_compile/bkp19.bkp new file mode 100644 index 0000000000..d69c01c294 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp19.bkp @@ -0,0 +1,18 @@ +unit r where + signature H where + newtype Foo = Foo Bool + -- NB: Foo here gets compiled into Foo{v} on the RHS, referring + -- to the DataCon wrapper! + -- (There should be a test for type class too) + module M where + import H + d = Foo True + +unit h-impl where + module A where + newtype Foo = Foo Bool + module H(Foo(..)) where + import A + +unit s where + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp19.stderr b/testsuite/tests/backpack/should_compile/bkp19.stderr new file mode 100644 index 0000000000..952fd0ae0c --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp19.stderr @@ -0,0 +1,13 @@ +[1 of 3] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[2 of 3] Processing h-impl + Instantiating h-impl + [1 of 2] Compiling A ( h-impl/A.hs, bkp19.out/h-impl/A.o ) + [2 of 2] Compiling H ( h-impl/H.hs, bkp19.out/h-impl/H.o ) +[3 of 3] Processing s + Instantiating s + [1 of 1] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp19.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp19.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp20.bkp b/testsuite/tests/backpack/should_compile/bkp20.bkp new file mode 100644 index 0000000000..38831d150b --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp20.bkp @@ -0,0 +1,22 @@ +{-# LANGUAGE TypeFamilies #-} + +unit p where + signature H where + type family Elem c + +unit q where + signature H where + type family Elem c + +unit r where + dependency p[H=<H>] + dependency q[H=<H>] + module M where + import H + type instance Elem Bool = Int + +unit h-impl where + module H where + type family Elem c +unit s where + dependency r[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_compile/bkp20.stderr b/testsuite/tests/backpack/should_compile/bkp20.stderr new file mode 100644 index 0000000000..4dfdd7c337 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp20.stderr @@ -0,0 +1,22 @@ +[1 of 5] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 5] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 5] Processing r + [1 of 2] Compiling H[sig] ( r/H.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) +[4 of 5] Processing h-impl + Instantiating h-impl + [1 of 1] Compiling H ( h-impl/H.hs, bkp20.out/h-impl/H.o ) +[5 of 5] Processing s + Instantiating s + [1 of 1] Including r[H=h-impl:H] + Instantiating r[H=h-impl:H] + [1 of 2] Including p[H=h-impl:H] + Instantiating p[H=h-impl:H] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkp20.out/p/p-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Including q[H=h-impl:H] + Instantiating q[H=h-impl:H] + [1 of 1] Compiling H[sig] ( q/H.hsig, bkp20.out/q/q-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [1 of 2] Compiling H[sig] ( r/H.hsig, bkp20.out/r/r-5FYQgnNkfSvBT5yogOxPpf/H.o ) + [2 of 2] Compiling M ( r/M.hs, bkp20.out/r/r-5FYQgnNkfSvBT5yogOxPpf/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp21.bkp b/testsuite/tests/backpack/should_compile/bkp21.bkp new file mode 100644 index 0000000000..b596460782 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp21.bkp @@ -0,0 +1,23 @@ +unit p where + signature H where + data T + +unit q where + signature H where + data T = T + +unit pq0 where + dependency p[H=<H>] + dependency q[H=<H>] + +unit pq1 where + dependency p[H=<H>] + dependency q[H=<H>] + signature H where + data T = T + +unit pq2 where + dependency p[H=<H>] + dependency q[H=<H>] + signature H where + data T diff --git a/testsuite/tests/backpack/should_compile/bkp21.stderr b/testsuite/tests/backpack/should_compile/bkp21.stderr new file mode 100644 index 0000000000..abfe9ceffc --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp21.stderr @@ -0,0 +1,10 @@ +[1 of 5] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 5] Processing q + [1 of 1] Compiling H[sig] ( q/H.hsig, nothing ) +[3 of 5] Processing pq0 + [1 of 1] Compiling H[sig] ( pq0/H.hsig, nothing ) +[4 of 5] Processing pq1 + [1 of 1] Compiling H[sig] ( pq1/H.hsig, nothing ) +[5 of 5] Processing pq2 + [1 of 1] Compiling H[sig] ( pq2/H.hsig, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp22.stderr b/testsuite/tests/backpack/should_compile/bkp22.stderr new file mode 100644 index 0000000000..7eb97b0de1 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp22.stderr @@ -0,0 +1,18 @@ +[1 of 4] Processing ab-sigs +unit ab-sigs[B=<B>, A=<A>] + [1 of 2] Compiling A[sig] ( ab-sigs/A.hsig, nothing ) + [2 of 2] Compiling B[sig] ( ab-sigs/B.hsig, nothing ) +[2 of 4] Processing ab +unit ab[B=<B>] +- include ab-sigs[B=<B>, A=<A>] [] + [1 of 2] Compiling B[sig] ( ab/B.hsig, nothing ) + [2 of 2] Compiling A ( ab/A.hs, nothing ) +[3 of 4] Processing ba +unit ba[A=<A>] +- include ab-sigs[B=<B>, A=<A>] [] + [1 of 2] Compiling A[sig] ( ba/A.hsig, nothing ) + [2 of 2] Compiling B ( ba/B.hs, nothing ) +[4 of 4] Processing ab-rec + Instantiating ab-rec + +bkp22.bkp:19:1: error: cycles not supported diff --git a/testsuite/tests/backpack/should_compile/bkp23.bkp b/testsuite/tests/backpack/should_compile/bkp23.bkp new file mode 100644 index 0000000000..8fed7d4113 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp23.bkp @@ -0,0 +1,42 @@ +-- Test to make sure that we can handle all orderings of inherited signatures +unit p where + signature A where + data A + signature B where + import A + data B = B A + module M where + import A + import B + data M = M A B +unit q1 where + dependency p[A=<A>,B=<B>] + signature A where + signature B where + module Q where + import M + f (M x y) = M x y +unit q2 where + dependency p[A=<A>,B=<B>] + signature B where + signature A where + module Q where + import M + f (M x y) = M x y +unit q3 where + dependency p[A=<A>,B=<B>] + module Q where + import M + f (M x y) = M x y +unit q4 where + dependency p[A=<A>,B=<B>] + signature A where + module Q where + import M + f (M x y) = M x y +unit q5 where + dependency p[A=<A>,B=<B>] + signature B where + module Q where + import M + f (M x y) = M x y diff --git a/testsuite/tests/backpack/should_compile/bkp23.stderr b/testsuite/tests/backpack/should_compile/bkp23.stderr new file mode 100644 index 0000000000..ea30294f15 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp23.stderr @@ -0,0 +1,24 @@ +[1 of 6] Processing p + [1 of 3] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( p/B.hsig, nothing ) + [3 of 3] Compiling M ( p/M.hs, nothing ) +[2 of 6] Processing q1 + [1 of 3] Compiling A[sig] ( q1/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q1/B.hsig, nothing ) + [3 of 3] Compiling Q ( q1/Q.hs, nothing ) +[3 of 6] Processing q2 + [1 of 3] Compiling A[sig] ( q2/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q2/B.hsig, nothing ) + [3 of 3] Compiling Q ( q2/Q.hs, nothing ) +[4 of 6] Processing q3 + [1 of 3] Compiling A[sig] ( q3/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q3/B.hsig, nothing ) + [3 of 3] Compiling Q ( q3/Q.hs, nothing ) +[5 of 6] Processing q4 + [1 of 3] Compiling A[sig] ( q4/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q4/B.hsig, nothing ) + [3 of 3] Compiling Q ( q4/Q.hs, nothing ) +[6 of 6] Processing q5 + [1 of 3] Compiling A[sig] ( q5/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q5/B.hsig, nothing ) + [3 of 3] Compiling Q ( q5/Q.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp24.bkp b/testsuite/tests/backpack/should_compile/bkp24.bkp new file mode 100644 index 0000000000..1547185b1d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp24.bkp @@ -0,0 +1,30 @@ +unit p where + signature A where + data A + signature B where + data B + module P where + import A + import B + data P = M A B +unit a where + module A where + data A = A +unit b where + module B where + data B = B +unit q where + dependency p[A=a:A,B=<B>] + dependency a + module Q where + import A + import B + import P + data Q = Q P A B +unit r where + dependency q[B=b:B] + dependency b + module R where + import B + import Q + data R = R Q B diff --git a/testsuite/tests/backpack/should_compile/bkp24.stderr b/testsuite/tests/backpack/should_compile/bkp24.stderr new file mode 100644 index 0000000000..73e1f9d6fb --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp24.stderr @@ -0,0 +1,27 @@ +[1 of 5] Processing p + [1 of 3] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( p/B.hsig, nothing ) + [3 of 3] Compiling P ( p/P.hs, nothing ) +[2 of 5] Processing a + Instantiating a + [1 of 1] Compiling A ( a/A.hs, bkp24.out/a/A.o ) +[3 of 5] Processing b + Instantiating b + [1 of 1] Compiling B ( b/B.hs, bkp24.out/b/B.o ) +[4 of 5] Processing q + [1 of 2] Compiling B[sig] ( q/B.hsig, nothing ) + [2 of 2] Compiling Q ( q/Q.hs, nothing ) +[5 of 5] Processing r + Instantiating r + [1 of 2] Including q[B=b:B] + Instantiating q[B=b:B] + [1 of 2] Including p[A=a:A, B=b:B] + Instantiating p[A=a:A, B=b:B] + [1 of 3] Compiling A[sig] ( p/A.hsig, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/A.o ) + [2 of 3] Compiling B[sig] ( p/B.hsig, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/B.o ) + [3 of 3] Compiling P ( p/P.hs, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/P.o ) + [2 of 2] Including a + [1 of 2] Compiling B[sig] ( q/B.hsig, bkp24.out/q/q-3IeW1YRs0cYLmV4oNjoWji/B.o ) + [2 of 2] Compiling Q ( q/Q.hs, bkp24.out/q/q-3IeW1YRs0cYLmV4oNjoWji/Q.o ) + [2 of 2] Including b + [1 of 1] Compiling R ( r/R.hs, bkp24.out/r/R.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp25.bkp b/testsuite/tests/backpack/should_compile/bkp25.bkp new file mode 100644 index 0000000000..fb26323d54 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp25.bkp @@ -0,0 +1,28 @@ +unit p where + signature A(A) where + data A + signature B(A) where + import A + module P where + import A + import B + type ZZ = A + +unit r where + module Impl where + data A = A + +unit q where + dependency p[A=<A>,B=<B>] + dependency r + signature A(A) where + import Impl(A) + signature B(A) where + import Impl(A) + module M where + import A + import B + import P + type AA = A + f :: ZZ -> AA + f x = x diff --git a/testsuite/tests/backpack/should_compile/bkp25.stderr b/testsuite/tests/backpack/should_compile/bkp25.stderr new file mode 100644 index 0000000000..55d6e4850a --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp25.stderr @@ -0,0 +1,11 @@ +[1 of 3] Processing p + [1 of 3] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( p/B.hsig, nothing ) + [3 of 3] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing r + Instantiating r + [1 of 1] Compiling Impl ( r/Impl.hs, bkp25.out/r/Impl.o ) +[3 of 3] Processing q + [1 of 3] Compiling A[sig] ( q/A.hsig, nothing ) + [2 of 3] Compiling B[sig] ( q/B.hsig, nothing ) + [3 of 3] Compiling M ( q/M.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp26.bkp b/testsuite/tests/backpack/should_compile/bkp26.bkp new file mode 100644 index 0000000000..6998f00399 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp26.bkp @@ -0,0 +1,21 @@ +unit p where + signature A where + data A + neg :: A -> A + module P where + import A + f :: A -> A + f = neg . neg + +unit r where + module A where + type A = Bool + neg :: A -> A + neg = not + +unit q where + dependency p[A=r:A] + module M where + import P + g :: Bool + g = f True diff --git a/testsuite/tests/backpack/should_compile/bkp26.stderr b/testsuite/tests/backpack/should_compile/bkp26.stderr new file mode 100644 index 0000000000..64960b15c7 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp26.stderr @@ -0,0 +1,13 @@ +[1 of 3] Processing p + [1 of 2] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 2] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing r + Instantiating r + [1 of 1] Compiling A ( r/A.hs, bkp26.out/r/A.o ) +[3 of 3] Processing q + Instantiating q + [1 of 1] Including p[A=r:A] + Instantiating p[A=r:A] + [1 of 2] Compiling A[sig] ( p/A.hsig, bkp26.out/p/p-8YQRY0unRYZCev5HBjXieS/A.o ) + [2 of 2] Compiling P ( p/P.hs, bkp26.out/p/p-8YQRY0unRYZCev5HBjXieS/P.o ) + [1 of 1] Compiling M ( q/M.hs, bkp26.out/q/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp27.bkp b/testsuite/tests/backpack/should_compile/bkp27.bkp new file mode 100644 index 0000000000..750418f80d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp27.bkp @@ -0,0 +1,25 @@ +unit p where + signature A where + data A + neg :: A -> A + module P where + import A + f :: A -> A + f = neg . neg + +unit r where + module A where + data B = X | Y + type A = B + neg :: B -> B + neg X = Y + neg Y = X + +unit q where + dependency p[A=r:A] + dependency r + module M where + import P + import A + g :: B + g = f X diff --git a/testsuite/tests/backpack/should_compile/bkp27.stderr b/testsuite/tests/backpack/should_compile/bkp27.stderr new file mode 100644 index 0000000000..72722ed2ea --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp27.stderr @@ -0,0 +1,14 @@ +[1 of 3] Processing p + [1 of 2] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 2] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing r + Instantiating r + [1 of 1] Compiling A ( r/A.hs, bkp27.out/r/A.o ) +[3 of 3] Processing q + Instantiating q + [1 of 2] Including p[A=r:A] + Instantiating p[A=r:A] + [1 of 2] Compiling A[sig] ( p/A.hsig, bkp27.out/p/p-8YQRY0unRYZCev5HBjXieS/A.o ) + [2 of 2] Compiling P ( p/P.hs, bkp27.out/p/p-8YQRY0unRYZCev5HBjXieS/P.o ) + [2 of 2] Including r + [1 of 1] Compiling M ( q/M.hs, bkp27.out/q/M.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp28.bkp b/testsuite/tests/backpack/should_compile/bkp28.bkp new file mode 100644 index 0000000000..d2e403ccaf --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp28.bkp @@ -0,0 +1,17 @@ +unit i where + module I where + data I = I +unit p where + dependency i + signature A(I,f,g) where + import I + f :: I -> I + g :: I +unit q where + dependency p[A=<A>] + signature A where + data I + f :: I -> I + module B where + import A + x = f g diff --git a/testsuite/tests/backpack/should_compile/bkp28.stderr b/testsuite/tests/backpack/should_compile/bkp28.stderr new file mode 100644 index 0000000000..9ea43fcb45 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp28.stderr @@ -0,0 +1,8 @@ +[1 of 3] Processing i + Instantiating i + [1 of 1] Compiling I ( i/I.hs, bkp28.out/i/I.o ) +[2 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[3 of 3] Processing q + [1 of 2] Compiling A[sig] ( q/A.hsig, nothing ) + [2 of 2] Compiling B ( q/B.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp29.bkp b/testsuite/tests/backpack/should_compile/bkp29.bkp new file mode 100644 index 0000000000..f58605fb03 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp29.bkp @@ -0,0 +1,14 @@ +unit p where + signature A where + data I + x :: I +unit q where + signature B where + data I + f :: I -> I +unit r where + dependency p[A=<C>] + dependency q[B=<C>] + module M where + import C + g = f x diff --git a/testsuite/tests/backpack/should_compile/bkp29.stderr b/testsuite/tests/backpack/should_compile/bkp29.stderr new file mode 100644 index 0000000000..1f4652b3a2 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp29.stderr @@ -0,0 +1,7 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling B[sig] ( q/B.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling C[sig] ( r/C.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp30.bkp b/testsuite/tests/backpack/should_compile/bkp30.bkp new file mode 100644 index 0000000000..9a260b41cc --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp30.bkp @@ -0,0 +1,15 @@ +unit p where + signature A where + data I + x :: I + y :: I +unit q where + signature B where + type I = Int + x :: Int +unit r where + dependency p[A=<C>] + dependency q[B=<C>] + module M where + import C + z = x + y + 2 diff --git a/testsuite/tests/backpack/should_compile/bkp30.stderr b/testsuite/tests/backpack/should_compile/bkp30.stderr new file mode 100644 index 0000000000..1f4652b3a2 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp30.stderr @@ -0,0 +1,7 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling B[sig] ( q/B.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling C[sig] ( r/C.hsig, nothing ) + [2 of 2] Compiling M ( r/M.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp31.bkp b/testsuite/tests/backpack/should_compile/bkp31.bkp new file mode 100644 index 0000000000..4816dfaa1d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp31.bkp @@ -0,0 +1,16 @@ +-- Paper example from Backpack'14 + +unit ab-sigs where + signature A where + x :: Bool + signature B where + y :: Bool + +unit abcd-holes where + dependency ab-sigs[A=<A>,B=<B>] + module C where + x = False + module D where + import qualified A + import qualified C + z = A.x && C.x diff --git a/testsuite/tests/backpack/should_compile/bkp31.stderr b/testsuite/tests/backpack/should_compile/bkp31.stderr new file mode 100644 index 0000000000..523a635d3a --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp31.stderr @@ -0,0 +1,8 @@ +[1 of 2] Processing ab-sigs + [1 of 2] Compiling A[sig] ( ab-sigs/A.hsig, nothing ) + [2 of 2] Compiling B[sig] ( ab-sigs/B.hsig, nothing ) +[2 of 2] Processing abcd-holes + [1 of 4] Compiling C ( abcd-holes/C.hs, nothing ) + [2 of 4] Compiling B[sig] ( abcd-holes/B.hsig, nothing ) + [3 of 4] Compiling A[sig] ( abcd-holes/A.hsig, nothing ) + [4 of 4] Compiling D ( abcd-holes/D.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp32.bkp b/testsuite/tests/backpack/should_compile/bkp32.bkp new file mode 100644 index 0000000000..92f37a5a05 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp32.bkp @@ -0,0 +1,92 @@ +{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE ScopedTypeVariables #-} +unit prelude-sig where + signature Prel where + data List a = Nil | Cons a (List a) + +unit arrays-sig where + dependency prelude-sig[Prel=<Prel>] + signature Array where + import Prel + data Arr i e + something :: List (Arr i e) + +unit structures where + dependency arrays-sig[Prel=<Prel>, Array=<Array>] + module Set where + import Prel + data S a = S (List a) + module Graph where + import Prel + import Array + data G = G (Arr Int [Int]) + module Tree where + import Prel + import Graph + data T = T G + +unit arrays-a where + dependency prelude-sig[Prel=<Prel>] + module Array where + import qualified Prel as P + type role Arr representational representational + data Arr i e = MkArr () + something :: P.List (Arr i e) + something = P.Nil + +unit arrays-b where + dependency prelude-sig[Prel=<Prel>] + module Array where + import Prel + data Arr i e = ANil | ACons i e (Arr i e) + -- NB: If you uncomment this, GHC decides to order the + -- quantifiers the other way, and you are a sad panda. + something :: Prel.List (Arr i e) + something = Cons ANil Nil + +unit graph-a where + dependency arrays-a[Prel=<Prel>] + dependency structures[Prel=<Prel>,Array=arrays-a[Prel=<Prel>]:Array] (Graph) + +unit graph-b where + dependency arrays-b[Prel=<Prel>] + dependency structures[Prel=<Prel>,Array=arrays-b[Prel=<Prel>]:Array] (Graph) + +unit multiinst where + dependency arrays-a[Prel=<Prel>] (Array as AA) + dependency arrays-b[Prel=<Prel>] (Array as AB) + dependency structures[Prel=<Prel>,Array=arrays-a[Prel=<Prel>]:Array] (Graph as GA) + dependency structures[Prel=<Prel>,Array=arrays-b[Prel=<Prel>]:Array] (Graph as GB) + module Client where + import qualified GA + import qualified GB + x = GA.G + y = GB.G + instance Show GA.G where + show = undefined + instance Show GB.G where + show = undefined + +unit applic-left where + dependency arrays-a[Prel=<Prel>] + dependency structures[Prel=<Prel>,Array=arrays-a[Prel=<Prel>]:Array] (Graph) + module Left where + import Graph + x :: G + x = undefined + +unit applic-right where + dependency arrays-a[Prel=<Prel>] + dependency structures[Prel=<Prel>,Array=arrays-a[Prel=<Prel>]:Array] (Graph) + module Right where + import Graph + f :: G -> G + f = id + +unit applic-bot where + dependency applic-left[Prel=<Prel>] + dependency applic-right[Prel=<Prel>] + module Bot where + import Left + import Right + g = f x diff --git a/testsuite/tests/backpack/should_compile/bkp32.stderr b/testsuite/tests/backpack/should_compile/bkp32.stderr new file mode 100644 index 0000000000..c2cea8c2b0 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp32.stderr @@ -0,0 +1,33 @@ +[ 1 of 11] Processing prelude-sig + [1 of 1] Compiling Prel[sig] ( prelude-sig/Prel.hsig, nothing ) +[ 2 of 11] Processing arrays-sig + [1 of 2] Compiling Prel[sig] ( arrays-sig/Prel.hsig, nothing ) + [2 of 2] Compiling Array[sig] ( arrays-sig/Array.hsig, nothing ) +[ 3 of 11] Processing structures + [1 of 5] Compiling Prel[sig] ( structures/Prel.hsig, nothing ) + [2 of 5] Compiling Array[sig] ( structures/Array.hsig, nothing ) + [3 of 5] Compiling Graph ( structures/Graph.hs, nothing ) + [4 of 5] Compiling Tree ( structures/Tree.hs, nothing ) + [5 of 5] Compiling Set ( structures/Set.hs, nothing ) +[ 4 of 11] Processing arrays-a + [1 of 2] Compiling Prel[sig] ( arrays-a/Prel.hsig, nothing ) + [2 of 2] Compiling Array ( arrays-a/Array.hs, nothing ) +[ 5 of 11] Processing arrays-b + [1 of 2] Compiling Prel[sig] ( arrays-b/Prel.hsig, nothing ) + [2 of 2] Compiling Array ( arrays-b/Array.hs, nothing ) +[ 6 of 11] Processing graph-a + [1 of 1] Compiling Prel[sig] ( graph-a/Prel.hsig, nothing ) +[ 7 of 11] Processing graph-b + [1 of 1] Compiling Prel[sig] ( graph-b/Prel.hsig, nothing ) +[ 8 of 11] Processing multiinst + [1 of 2] Compiling Prel[sig] ( multiinst/Prel.hsig, nothing ) + [2 of 2] Compiling Client ( multiinst/Client.hs, nothing ) +[ 9 of 11] Processing applic-left + [1 of 2] Compiling Prel[sig] ( applic-left/Prel.hsig, nothing ) + [2 of 2] Compiling Left ( applic-left/Left.hs, nothing ) +[10 of 11] Processing applic-right + [1 of 2] Compiling Prel[sig] ( applic-right/Prel.hsig, nothing ) + [2 of 2] Compiling Right ( applic-right/Right.hs, nothing ) +[11 of 11] Processing applic-bot + [1 of 2] Compiling Prel[sig] ( applic-bot/Prel.hsig, nothing ) + [2 of 2] Compiling Bot ( applic-bot/Bot.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp33.bkp b/testsuite/tests/backpack/should_compile/bkp33.bkp new file mode 100644 index 0000000000..67d1f12abe --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp33.bkp @@ -0,0 +1,21 @@ +{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} +unit sig where + signature A where + data T + instance Show T + module M where + import A + f :: T -> String + f x = show x + +unit mod where + module A where + type T = String + +unit join where + dependency sig[A=mod:A] + dependency mod + module S where + import M + g :: String -> String + g x = f (x ++ "a") diff --git a/testsuite/tests/backpack/should_compile/bkp33.stderr b/testsuite/tests/backpack/should_compile/bkp33.stderr new file mode 100644 index 0000000000..4fa8b755b0 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp33.stderr @@ -0,0 +1,14 @@ +[1 of 3] Processing sig + [1 of 2] Compiling A[sig] ( sig/A.hsig, nothing ) + [2 of 2] Compiling M ( sig/M.hs, nothing ) +[2 of 3] Processing mod + Instantiating mod + [1 of 1] Compiling A ( mod/A.hs, bkp33.out/mod/A.o ) +[3 of 3] Processing join + Instantiating join + [1 of 2] Including sig[A=mod:A] + Instantiating sig[A=mod:A] + [1 of 2] Compiling A[sig] ( sig/A.hsig, bkp33.out/sig/sig-HyoWTHt34SDIRGEX0vZ8iN/A.o ) + [2 of 2] Compiling M ( sig/M.hs, bkp33.out/sig/sig-HyoWTHt34SDIRGEX0vZ8iN/M.o ) + [2 of 2] Including mod + [1 of 1] Compiling S ( join/S.hs, bkp33.out/join/S.o ) diff --git a/testsuite/tests/backpack/should_compile/bkp34.bkp b/testsuite/tests/backpack/should_compile/bkp34.bkp new file mode 100644 index 0000000000..c2bea1fd93 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp34.bkp @@ -0,0 +1,20 @@ +{-# LANGUAGE FlexibleInstances #-} +unit p where + signature A where + data K a + instance Show (K Int) + instance Show (K Bool) +unit q where + signature A where + data K a + instance Show (K Bool) + instance Show (K Int) +unit r where + dependency p[A=<A>] + dependency q[A=<A>] + module R where + import A + f :: K Int -> String + f = show + g :: K Bool -> String + g = show diff --git a/testsuite/tests/backpack/should_compile/bkp34.stderr b/testsuite/tests/backpack/should_compile/bkp34.stderr new file mode 100644 index 0000000000..14aa7a843b --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp34.stderr @@ -0,0 +1,7 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A[sig] ( q/A.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling A[sig] ( r/A.hsig, nothing ) + [2 of 2] Compiling R ( r/R.hs, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp35.bkp b/testsuite/tests/backpack/should_compile/bkp35.bkp new file mode 100644 index 0000000000..76e9ace811 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp35.bkp @@ -0,0 +1,28 @@ +{-# LANGUAGE FlexibleInstances #-} +unit p where + signature A where + data K a + instance Read a => Show (K a) +unit q where + signature A where + data K a + instance Show a => Show (K a) +unit r where + dependency p[A=<A>] + dependency q[A=<A>] + -- At the moment, the merge arbitrarily picks one of the + -- instances to make available, so only one of these statements + -- will typecheck. Somehow need an OR constraint (but type + -- class solver doesn't backtrack, so that ain't gonna work). + -- + -- It's actually a bit interesting to decide what this should + -- be: "instance Show a" would satisfy both of these, but + -- nothing else seems to work (incoherent instance is not + -- enough because GHC could pick the wrong instance and then + -- fail to solve the constraint.) + module R where + import A + f :: Show a => K a -> String + f = show + g :: Read a => K a -> String + g = show diff --git a/testsuite/tests/backpack/should_compile/bkp36.bkp b/testsuite/tests/backpack/should_compile/bkp36.bkp new file mode 100644 index 0000000000..abe76ca728 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp36.bkp @@ -0,0 +1,22 @@ +{-# LANGUAGE TypeFamilies #-} +unit f where + module F where + type family F a +unit p where + dependency f + signature A where + data T + module P where + import F + import A + type instance F T = Bool +unit q where + dependency p[A=<B>] + dependency f + module Q where + import F + import B + import P + x :: F T + x = True + diff --git a/testsuite/tests/backpack/should_compile/bkp36.stderr b/testsuite/tests/backpack/should_compile/bkp36.stderr new file mode 100644 index 0000000000..45ade1412f --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp36.stderr @@ -0,0 +1,9 @@ +[1 of 3] Processing f + Instantiating f + [1 of 1] Compiling F ( f/F.hs, bkp36.out/f/F.o ) +[2 of 3] Processing p + [1 of 2] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 2] Compiling P ( p/P.hs, nothing ) +[3 of 3] Processing q + [1 of 2] Compiling B[sig] ( q/B.hsig, nothing ) + [2 of 2] Compiling Q ( q/Q.hs, nothing ) diff --git a/testsuite/tests/backpack/should_fail/Makefile b/testsuite/tests/backpack/should_fail/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/backpack/should_fail/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/should_fail/all.T b/testsuite/tests/backpack/should_fail/all.T new file mode 100644 index 0000000000..d414cf03c3 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/all.T @@ -0,0 +1,21 @@ +test('bkpfail01', normal, backpack_typecheck_fail, ['']) +test('bkpfail03', normal, backpack_typecheck_fail, ['']) +test('bkpfail04', normal, backpack_typecheck_fail, ['']) +test('bkpfail05', normal, backpack_compile_fail, ['']) +test('bkpfail06', normal, backpack_compile_fail, ['']) +test('bkpfail07', expect_broken(0), backpack_typecheck_fail, ['']) # could fix this but not priority +test('bkpfail09', normal, backpack_compile_fail, ['']) +test('bkpfail10', normal, backpack_compile_fail, ['']) +test('bkpfail11', normal, backpack_compile_fail, ['']) +test('bkpfail12', normal, backpack_compile_fail, ['']) +test('bkpfail13', normal, backpack_compile_fail, ['']) +test('bkpfail14', normal, backpack_compile_fail, ['']) +test('bkpfail15', expect_broken(0), backpack_compile_fail, ['']) # we don't error here... +test('bkpfail16', normal, backpack_compile_fail, ['']) +test('bkpfail17', normal, backpack_compile_fail, ['']) +test('bkpfail18', normal, backpack_compile_fail, ['']) +test('bkpfail19', normal, backpack_compile_fail, ['']) +test('bkpfail20', normal, backpack_compile_fail, ['']) +test('bkpfail21', normal, backpack_compile_fail, ['']) +# it does fail, but not quite in the right way yet... +test('bkpfail22', expect_broken(0), backpack_compile_fail, ['']) diff --git a/testsuite/tests/backpack/should_fail/bkpfail01.bkp b/testsuite/tests/backpack/should_fail/bkpfail01.bkp new file mode 100644 index 0000000000..04a69e5864 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail01.bkp @@ -0,0 +1,16 @@ +unit p where + signature H where + data H = H + module A where + import H + data A = A H + +unit q where + module H where + data S = S + +unit r where + dependency p[H=q:H] + module B where + import A + x = A H diff --git a/testsuite/tests/backpack/should_fail/bkpfail01.stderr b/testsuite/tests/backpack/should_fail/bkpfail01.stderr new file mode 100644 index 0000000000..ae27f1988b --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail01.stderr @@ -0,0 +1,17 @@ +[1 of 3] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling H ( q/H.hs, nothing ) +[3 of 3] Processing r + Instantiating r + [1 of 1] Including p[H=q:H] + Instantiating p[H=q:H] + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + +bkpfail01.out/p/p-D5Mg3foBSCrDbQDKH4WGSG/../H.hi:1:1: error: + ‘H’ is exported by the hsig file, but not exported the module ‘q:H’ + +bkpfail01.out/p/p-D5Mg3foBSCrDbQDKH4WGSG/../H.hi:1:1: error: + ‘H’ is exported by the hsig file, but not exported the module ‘q:H’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail03.bkp b/testsuite/tests/backpack/should_fail/bkpfail03.bkp new file mode 100644 index 0000000000..70be6d088d --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail03.bkp @@ -0,0 +1,10 @@ +unit q where + module M1 where + data M = M + signature M2(M) where + import M1 +unit m2 where + module M2 where + data M = M +unit p where + dependency q[M2=m2:M2] diff --git a/testsuite/tests/backpack/should_fail/bkpfail03.stderr b/testsuite/tests/backpack/should_fail/bkpfail03.stderr new file mode 100644 index 0000000000..0b66c2da36 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail03.stderr @@ -0,0 +1,16 @@ +[1 of 3] Processing q + [1 of 2] Compiling M1 ( q/M1.hs, nothing ) + [2 of 2] Compiling M2[sig] ( q/M2.hsig, nothing ) +[2 of 3] Processing m2 + Instantiating m2 + [1 of 1] Compiling M2 ( m2/M2.hs, nothing ) +[3 of 3] Processing p + Instantiating p + [1 of 1] Including q[M2=m2:M2] + Instantiating q[M2=m2:M2] + [1 of 2] Compiling M1 ( q/M1.hs, nothing ) + [2 of 2] Compiling M2[sig] ( q/M2.hsig, nothing ) + +bkpfail03.bkp:3:9: error: + The hsig file (re)exports ‘M1.M’ + but the implementing module exports a different identifier ‘M2.M’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail04.bkp b/testsuite/tests/backpack/should_fail/bkpfail04.bkp new file mode 100644 index 0000000000..987b566098 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail04.bkp @@ -0,0 +1,15 @@ +unit p where + signature A where + data A = A { foo :: Int } + +unit q where + signature A where + data A = A { bar :: Bool } + +unit r where + dependency p[A=<A>] + dependency q[A=<A>] + module M where + import A + x = foo + y = bar diff --git a/testsuite/tests/backpack/should_fail/bkpfail04.stderr b/testsuite/tests/backpack/should_fail/bkpfail04.stderr new file mode 100644 index 0000000000..48287cd650 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail04.stderr @@ -0,0 +1,15 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A[sig] ( q/A.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling A[sig] ( r/A.hsig, nothing ) + +bkpfail04.bkp:7:9: error: + Type constructor ‘A’ has conflicting definitions in the module + and its hsig file + Main module: data A = A {foo :: GHC.Types.Int} + Hsig file: data A = A {bar :: GHC.Types.Bool} + The constructors do not match: + The record label lists for ‘A’ differ + The types for ‘A’ differ diff --git a/testsuite/tests/backpack/should_fail/bkpfail05.bkp b/testsuite/tests/backpack/should_fail/bkpfail05.bkp new file mode 100644 index 0000000000..2bf58a181e --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail05.bkp @@ -0,0 +1,22 @@ +unit h where + signature H where + data T = T1 +unit t-impl where + module T where + data T = T2 +unit p where + dependency h[H=<H>] + dependency t-impl + -- Known bug: GHC will not eagerly report an error here although + -- it could, if it more aggressively checked for type-compatibility + -- when a hole gets resolved + signature H(T(..)) where + import T +unit h-impl where + dependency t-impl + module H(T(..)) where + import T +unit q where + -- Fortunately, you'll never be able to instantiate these signatures; + -- it's just an unsatisfiable set of constraints. + dependency p[H=h-impl:H] diff --git a/testsuite/tests/backpack/should_fail/bkpfail05.stderr b/testsuite/tests/backpack/should_fail/bkpfail05.stderr new file mode 100644 index 0000000000..25428e49f9 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail05.stderr @@ -0,0 +1,21 @@ +[1 of 5] Processing h + [1 of 1] Compiling H[sig] ( h/H.hsig, nothing ) +[2 of 5] Processing t-impl + Instantiating t-impl + [1 of 1] Compiling T ( t-impl/T.hs, bkpfail05.out/t-impl/T.o ) +[3 of 5] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[4 of 5] Processing h-impl + Instantiating h-impl + [1 of 1] Including t-impl + [1 of 1] Compiling H ( h-impl/H.hs, bkpfail05.out/h-impl/H.o ) +[5 of 5] Processing q + Instantiating q + [1 of 1] Including p[H=h-impl:H] + Instantiating p[H=h-impl:H] + [1 of 2] Including h[H=h-impl:H] + Instantiating h[H=h-impl:H] + [1 of 1] Compiling H[sig] ( h/H.hsig, bkpfail05.out/h/h-5FYQgnNkfSvBT5yogOxPpf/H.o ) + +bkpfail05.out/h/h-5FYQgnNkfSvBT5yogOxPpf/../H.hi:1:1: error: + ‘T1’ is exported by the hsig file, but not exported the module ‘h-impl:H’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail06.bkp b/testsuite/tests/backpack/should_fail/bkpfail06.bkp new file mode 100644 index 0000000000..14790168a8 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail06.bkp @@ -0,0 +1,14 @@ +unit p where + signature H where + data T = T Int + module A where + import H + f :: T -> Int + f (T x) = x +unit qimpl where + module T where + data T = T Bool + module H(T(..)) where + import T +unit q where + dependency p[H=qimpl:H] diff --git a/testsuite/tests/backpack/should_fail/bkpfail06.stderr b/testsuite/tests/backpack/should_fail/bkpfail06.stderr new file mode 100644 index 0000000000..1fb5d5311f --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail06.stderr @@ -0,0 +1,19 @@ +[1 of 3] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 3] Processing qimpl + Instantiating qimpl + [1 of 2] Compiling T ( qimpl/T.hs, bkpfail06.out/qimpl/T.o ) + [2 of 2] Compiling H ( qimpl/H.hs, bkpfail06.out/qimpl/H.o ) +[3 of 3] Processing q + Instantiating q + [1 of 1] Including p[H=qimpl:H] + Instantiating p[H=qimpl:H] + [1 of 2] Compiling H[sig] ( p/H.hsig, bkpfail06.out/p/p-IueY0RdHDM2I4k0mLZuqM0/H.o ) + +bkpfail06.bkp:10:9: error: + Type constructor ‘qimpl:T.T’ has conflicting definitions in the module + and its hsig file + Main module: data qimpl:T.T = qimpl:T.T GHC.Types.Bool + Hsig file: data qimpl:T.T = qimpl:T.T GHC.Types.Int + The constructors do not match: The types for ‘qimpl:T.T’ differ diff --git a/testsuite/tests/backpack/should_fail/bkpfail07.bkp b/testsuite/tests/backpack/should_fail/bkpfail07.bkp new file mode 100644 index 0000000000..cbbd95b272 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail07.bkp @@ -0,0 +1,10 @@ +unit p where + signature H where + data T = T Int +unit q where + signature A where -- indefinite version + module T where + data T = T Bool + module H(T(..)) where + import T + dependency p[H=<H>] diff --git a/testsuite/tests/backpack/should_fail/bkpfail07.stderr b/testsuite/tests/backpack/should_fail/bkpfail07.stderr new file mode 100644 index 0000000000..d6269b4cc2 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail07.stderr @@ -0,0 +1,14 @@ +[1 of 2] Processing p + [1 of 1] Compiling H[abstract sig] ( p/H.hsig, nothing ) +[2 of 2] Processing q + [1 of 4] Compiling A[abstract sig] ( q/A.hsig, nothing ) + [2 of 4] Compiling T ( q/T.hs, nothing ) + [3 of 4] Compiling H ( q/H.hs, nothing ) + [4 of 4] Including p + +bkpfail07.bkp:7:9: error: + Type constructor ‘T.T’ has conflicting definitions in the module + and its hsig file + Main module: data T.T = T.T Bool + Hsig file: data T.T = T.T Int + The constructors do not match: The types for ‘T.T’ differ diff --git a/testsuite/tests/backpack/should_fail/bkpfail09.bkp b/testsuite/tests/backpack/should_fail/bkpfail09.bkp new file mode 100644 index 0000000000..620378d1cf --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail09.bkp @@ -0,0 +1,19 @@ +unit p where + signature H where + data H = H + module A where + import H + data A = A H + +unit q where + module H where + data S = S + +unit r where + dependency p[H=q:H] + -- This test passes if r is definite, because we'll + -- first try to compile p. Key is to make r indefinite! + signature H2 where + module B where + import A + x = A H diff --git a/testsuite/tests/backpack/should_fail/bkpfail09.stderr b/testsuite/tests/backpack/should_fail/bkpfail09.stderr new file mode 100644 index 0000000000..a767abc15e --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail09.stderr @@ -0,0 +1,15 @@ +[1 of 3] Processing p + [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) + [2 of 2] Compiling A ( p/A.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling H ( q/H.hs, bkpfail09.out/q/H.o ) +[3 of 3] Processing r + +Command line argument: -unit-id p[H=H]:0:0: error: + • ‘H’ is exported by the hsig file, but not exported the module ‘q:H’ + • while checking that q:H implements signature H in p[H=q:H] + +Command line argument: -unit-id p[H=H]:0:0: error: + • ‘H’ is exported by the hsig file, but not exported the module ‘q:H’ + • while checking that q:H implements signature H in p[H=q:H] diff --git a/testsuite/tests/backpack/should_fail/bkpfail10.bkp b/testsuite/tests/backpack/should_fail/bkpfail10.bkp new file mode 100644 index 0000000000..10e07f1878 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail10.bkp @@ -0,0 +1,18 @@ +unit p where + signature H where + data H + f :: H -> H + +unit q where + module H where + data H a = H a + f :: H a -> H a + f x = x + +unit r where + dependency p[H=q:H] + dependency q + -- Once again, necessary + module B where + import H + type S = H diff --git a/testsuite/tests/backpack/should_fail/bkpfail10.stderr b/testsuite/tests/backpack/should_fail/bkpfail10.stderr new file mode 100644 index 0000000000..2c2b2f2a8b --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail10.stderr @@ -0,0 +1,24 @@ +[1 of 3] Processing p + [1 of 1] Compiling H[sig] ( p/H.hsig, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling H ( q/H.hs, bkpfail10.out/q/H.o ) +[3 of 3] Processing r + Instantiating r + [1 of 2] Including p[H=q:H] + Instantiating p[H=q:H] + [1 of 1] Compiling H[sig] ( p/H.hsig, bkpfail10.out/p/p-D5Mg3foBSCrDbQDKH4WGSG/H.o ) + +bkpfail10.bkp:8:9: error: + Type constructor ‘q:H.H’ has conflicting definitions in the module + and its hsig file + Main module: data q:H.H a = q:H.H a + Hsig file: abstract q:H.H + The types have different kinds + +bkpfail10.bkp:10:9: error: + Identifier ‘q:H.f’ has conflicting definitions in the module + and its hsig file + Main module: q:H.f :: q:H.H a -> q:H.H a + Hsig file: q:H.f :: q:H.H -> q:H.H + The two types are different diff --git a/testsuite/tests/backpack/should_fail/bkpfail11.bkp b/testsuite/tests/backpack/should_fail/bkpfail11.bkp new file mode 100644 index 0000000000..9fd49e5ff2 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail11.bkp @@ -0,0 +1,21 @@ +{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} +unit sig where + signature A where + data T + instance Show T + module M where + import A + f :: T -> String + f x = show x + +unit mod where + module A where + data X = X -- no Show instance + type T = [X] + +unit join where + dependency sig[A=mod:A] + module S where + import M + g :: String -> String + g x = f (x ++ "a") diff --git a/testsuite/tests/backpack/should_fail/bkpfail11.stderr b/testsuite/tests/backpack/should_fail/bkpfail11.stderr new file mode 100644 index 0000000000..065a2e6ed4 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail11.stderr @@ -0,0 +1,18 @@ +[1 of 3] Processing sig + [1 of 2] Compiling A[sig] ( sig/A.hsig, nothing ) + [2 of 2] Compiling M ( sig/M.hs, nothing ) +[2 of 3] Processing mod + Instantiating mod + [1 of 1] Compiling A ( mod/A.hs, bkpfail11.out/mod/A.o ) +[3 of 3] Processing join + Instantiating join + [1 of 1] Including sig[A=mod:A] + Instantiating sig[A=mod:A] + [1 of 2] Compiling A[sig] ( sig/A.hsig, bkpfail11.out/sig/sig-HyoWTHt34SDIRGEX0vZ8iN/A.o ) + +bkpfail11.out/sig/sig-HyoWTHt34SDIRGEX0vZ8iN/../A.hi:1:1: error: + No instance for (GHC.Show.Show mod:A.X) + arising when attempting to show that + instance [safe] GHC.Show.Show mod:A.T + -- Defined at bkpfail11.bkp:5:18 + is provided by ‘mod:A’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail12.bkp b/testsuite/tests/backpack/should_fail/bkpfail12.bkp new file mode 100644 index 0000000000..070f8bfdfb --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail12.bkp @@ -0,0 +1,14 @@ +-- Everything is easy +unit p where + signature Q where + f :: Int + module P where +unit q where + module Q where + f = True +unit r where + dependency p[Q=q:Q] + dependency q + signature H where + module R where + import P diff --git a/testsuite/tests/backpack/should_fail/bkpfail12.stderr b/testsuite/tests/backpack/should_fail/bkpfail12.stderr new file mode 100644 index 0000000000..224f23a86a --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail12.stderr @@ -0,0 +1,15 @@ +[1 of 3] Processing p + [1 of 2] Compiling Q[sig] ( p/Q.hsig, nothing ) + [2 of 2] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling Q ( q/Q.hs, bkpfail12.out/q/Q.o ) +[3 of 3] Processing r + +bkpfail12.bkp:8:9: error: + • Identifier ‘Q.f’ has conflicting definitions in the module + and its hsig file + Main module: Q.f :: GHC.Types.Bool + Hsig file: Q.f :: GHC.Types.Int + The two types are different + • while checking that Q implements signature Q in p[Q=Q] diff --git a/testsuite/tests/backpack/should_fail/bkpfail13.bkp b/testsuite/tests/backpack/should_fail/bkpfail13.bkp new file mode 100644 index 0000000000..55d32bd799 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail13.bkp @@ -0,0 +1,13 @@ +-- Q by a different name +unit p where + signature Q where + f :: Int + module P where +unit q where + module QMe where + f = True +unit r where + dependency p[Q=q:QMe] + signature H where + module R where + import P diff --git a/testsuite/tests/backpack/should_fail/bkpfail13.stderr b/testsuite/tests/backpack/should_fail/bkpfail13.stderr new file mode 100644 index 0000000000..34dbeb82c7 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail13.stderr @@ -0,0 +1,15 @@ +[1 of 3] Processing p + [1 of 2] Compiling Q[sig] ( p/Q.hsig, nothing ) + [2 of 2] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 1] Compiling QMe ( q/QMe.hs, bkpfail13.out/q/QMe.o ) +[3 of 3] Processing r + +bkpfail13.bkp:8:9: error: + • Identifier ‘q:QMe.f’ has conflicting definitions in the module + and its hsig file + Main module: q:QMe.f :: GHC.Types.Bool + Hsig file: q:QMe.f :: GHC.Types.Int + The two types are different + • while checking that q:QMe implements signature Q in p[Q=q:QMe] diff --git a/testsuite/tests/backpack/should_fail/bkpfail14.bkp b/testsuite/tests/backpack/should_fail/bkpfail14.bkp new file mode 100644 index 0000000000..d63cb25bf5 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail14.bkp @@ -0,0 +1,18 @@ +-- Q by a different name, differently +unit p where + signature Q where + f :: Int + signature Q2 where + module P where +unit q where + module QMe where + f = True + module Q where + g = 23 + module Q2 where +unit r where + dependency p[Q=q:QMe, Q2=q:Q2] + dependency q + signature H where + module R where + import P diff --git a/testsuite/tests/backpack/should_fail/bkpfail14.stderr b/testsuite/tests/backpack/should_fail/bkpfail14.stderr new file mode 100644 index 0000000000..bdccdee938 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail14.stderr @@ -0,0 +1,18 @@ +[1 of 3] Processing p + [1 of 3] Compiling Q[sig] ( p/Q.hsig, nothing ) + [2 of 3] Compiling Q2[sig] ( p/Q2.hsig, nothing ) + [3 of 3] Compiling P ( p/P.hs, nothing ) +[2 of 3] Processing q + Instantiating q + [1 of 3] Compiling QMe ( q/QMe.hs, bkpfail14.out/q/QMe.o ) + [2 of 3] Compiling Q ( q/Q.hs, bkpfail14.out/q/Q.o ) + [3 of 3] Compiling Q2 ( q/Q2.hs, bkpfail14.out/q/Q2.o ) +[3 of 3] Processing r + +bkpfail14.bkp:9:9: error: + • Identifier ‘QMe.f’ has conflicting definitions in the module + and its hsig file + Main module: QMe.f :: GHC.Types.Bool + Hsig file: QMe.f :: GHC.Types.Int + The two types are different + • while checking that QMe implements signature Q in p[Q=QMe, Q2=Q2] diff --git a/testsuite/tests/backpack/should_fail/bkpfail15.bkp b/testsuite/tests/backpack/should_fail/bkpfail15.bkp new file mode 100644 index 0000000000..9b84598af8 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail15.bkp @@ -0,0 +1,12 @@ +unit p where + signature A where + signature Q where + f :: Int + module P where +unit q where + module Q where + f = True +-- This should error, but there's no instantiation check +-- without a dependency on P +unit r where + dependency p[Q=q:Q,A=<A>] diff --git a/testsuite/tests/backpack/should_fail/bkpfail16.bkp b/testsuite/tests/backpack/should_fail/bkpfail16.bkp new file mode 100644 index 0000000000..52576e9d08 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail16.bkp @@ -0,0 +1,5 @@ +unit p where + signature ShouldFail where + data Booly +unit q where + dependency p[ShouldFail=base:Data.Bool] diff --git a/testsuite/tests/backpack/should_fail/bkpfail16.stderr b/testsuite/tests/backpack/should_fail/bkpfail16.stderr new file mode 100644 index 0000000000..a92352c26d --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail16.stderr @@ -0,0 +1,10 @@ +[1 of 2] Processing p + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, nothing ) +[2 of 2] Processing q + Instantiating q + [1 of 1] Including p[ShouldFail=base-4.9.0.0:Data.Bool] + Instantiating p[ShouldFail=base-4.9.0.0:Data.Bool] + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, bkpfail16.out/p/p-1OqLaT7dAn947wScQQKCw5/ShouldFail.o ) + +bkpfail16.out/p/p-1OqLaT7dAn947wScQQKCw5/../ShouldFail.hi:1:1: error: + ‘Booly’ is exported by the hsig file, but not exported the module ‘Data.Bool’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail17.bkp b/testsuite/tests/backpack/should_fail/bkpfail17.bkp new file mode 100644 index 0000000000..847bdfaf58 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail17.bkp @@ -0,0 +1,6 @@ +{-# LANGUAGE NoImplicitPrelude #-} +unit p where + signature ShouldFail where + data Either a b c = Left a +unit q where + dependency p[ShouldFail=base:Prelude] diff --git a/testsuite/tests/backpack/should_fail/bkpfail17.stderr b/testsuite/tests/backpack/should_fail/bkpfail17.stderr new file mode 100644 index 0000000000..99cecef7dc --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail17.stderr @@ -0,0 +1,16 @@ +[1 of 2] Processing p + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, nothing ) +[2 of 2] Processing q + Instantiating q + [1 of 1] Including p[ShouldFail=base-4.9.0.0:Prelude] + Instantiating p[ShouldFail=base-4.9.0.0:Prelude] + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, bkpfail17.out/p/p-2W6J7O3LvroH97zGxbPEGF/ShouldFail.o ) + +<no location info>: error: + Type constructor ‘Data.Either.Either’ has conflicting definitions in the module + and its hsig file + Main module: data Data.Either.Either a b + = Data.Either.Left a | Data.Either.Right b + Hsig file: type role Data.Either.Either representational phantom phantom + data Data.Either.Either a b c = Data.Either.Left a + The types have different kinds diff --git a/testsuite/tests/backpack/should_fail/bkpfail18.bkp b/testsuite/tests/backpack/should_fail/bkpfail18.bkp new file mode 100644 index 0000000000..e8c436af65 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail18.bkp @@ -0,0 +1,4 @@ +unit p where + signature ShouldFail where + instance Show Int + instance Show Int diff --git a/testsuite/tests/backpack/should_fail/bkpfail18.stderr b/testsuite/tests/backpack/should_fail/bkpfail18.stderr new file mode 100644 index 0000000000..ac66507f8c --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail18.stderr @@ -0,0 +1,12 @@ +[1 of 1] Processing p + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, nothing ) + +bkpfail18.bkp:3:18: error: + Duplicate instance declarations: + instance Show Int -- Defined at bkpfail18.bkp:3:18 + instance Show Int -- Defined in ‘GHC.Show’ + +bkpfail18.bkp:4:18: error: + Duplicate instance declarations: + instance Show Int -- Defined at bkpfail18.bkp:4:18 + instance Show Int -- Defined in ‘GHC.Show’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail19.bkp b/testsuite/tests/backpack/should_fail/bkpfail19.bkp new file mode 100644 index 0000000000..1752b7c074 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail19.bkp @@ -0,0 +1,5 @@ +unit p where + signature ShouldFail(newSTRef) where + import Data.STRef.Lazy(newSTRef) +unit q where + dependency p[ShouldFail=base:Data.STRef] diff --git a/testsuite/tests/backpack/should_fail/bkpfail19.stderr b/testsuite/tests/backpack/should_fail/bkpfail19.stderr new file mode 100644 index 0000000000..73f358c8cb --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail19.stderr @@ -0,0 +1,11 @@ +[1 of 2] Processing p + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, nothing ) +[2 of 2] Processing q + Instantiating q + [1 of 1] Including p[ShouldFail=base-4.9.0.0:Data.STRef] + Instantiating p[ShouldFail=base-4.9.0.0:Data.STRef] + [1 of 1] Compiling ShouldFail[sig] ( p/ShouldFail.hsig, bkpfail19.out/p/p-CfyUIAu1JTRCDuXEyGszXN/ShouldFail.o ) + +<no location info>: error: + The hsig file (re)exports ‘Data.STRef.Lazy.newSTRef’ + but the implementing module exports a different identifier ‘GHC.STRef.newSTRef’ diff --git a/testsuite/tests/backpack/should_fail/bkpfail20.bkp b/testsuite/tests/backpack/should_fail/bkpfail20.bkp new file mode 100644 index 0000000000..18d497347b --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail20.bkp @@ -0,0 +1,9 @@ +unit p where + signature A(newSTRef) where + import Data.STRef.Lazy(newSTRef) +unit q where + signature A(newSTRef) where + import Data.STRef.Strict(newSTRef) +unit r where + dependency p[A=<B>] + dependency q[A=<B>] diff --git a/testsuite/tests/backpack/should_fail/bkpfail20.stderr b/testsuite/tests/backpack/should_fail/bkpfail20.stderr new file mode 100644 index 0000000000..df010b9018 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail20.stderr @@ -0,0 +1,9 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A[sig] ( q/A.hsig, nothing ) +[3 of 3] Processing r + [1 of 1] Compiling B[sig] ( r/B.hsig, nothing ) + +bkpfail20.bkp:1:1: error: + While merging export lists, could not unify Data.STRef.Lazy.newSTRef with GHC.STRef.newSTRef diff --git a/testsuite/tests/backpack/should_fail/bkpfail21.bkp b/testsuite/tests/backpack/should_fail/bkpfail21.bkp new file mode 100644 index 0000000000..322fe5172c --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail21.bkp @@ -0,0 +1,13 @@ +unit p where + signature A where + data T + signature C(T) where + import A +unit q where + signature B where + data T + signature C(T) where + import B +unit r where + dependency p[A=<H1>,C=<H3>] + dependency q[B=<H2>,C=<H3>] diff --git a/testsuite/tests/backpack/should_fail/bkpfail21.stderr b/testsuite/tests/backpack/should_fail/bkpfail21.stderr new file mode 100644 index 0000000000..258bf71e96 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail21.stderr @@ -0,0 +1,14 @@ +[1 of 3] Processing p + [1 of 2] Compiling A[sig] ( p/A.hsig, nothing ) + [2 of 2] Compiling C[sig] ( p/C.hsig, nothing ) +[2 of 3] Processing q + [1 of 2] Compiling B[sig] ( q/B.hsig, nothing ) + [2 of 2] Compiling C[sig] ( q/C.hsig, nothing ) +[3 of 3] Processing r + [1 of 3] Compiling H2[sig] ( r/H2.hsig, nothing ) + [2 of 3] Compiling H1[sig] ( r/H1.hsig, nothing ) + [3 of 3] Compiling H3[sig] ( r/H3.hsig, nothing ) + +bkpfail21.bkp:1:1: error: + While merging export lists, could not unify {H1.T} with {H2.T} + Neither name variable originates from the current signature. diff --git a/testsuite/tests/backpack/should_fail/bkpfail22.bkp b/testsuite/tests/backpack/should_fail/bkpfail22.bkp new file mode 100644 index 0000000000..1217aa0456 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail22.bkp @@ -0,0 +1,21 @@ +unit p where + signature H where + type T = Int + module M where + import H + f :: T + f = 2 +unit q where + signature H2 where + type S = Bool + module N where + import H2 + type T = Int +unit badimpl where + module H2 where + type S = () +unit check where + dependency p[H=q[H2=badimpl:H2]:N] + -- signature H3 where + module C where + import M diff --git a/testsuite/tests/backpack/should_fail/bkpfail22.stderr b/testsuite/tests/backpack/should_fail/bkpfail22.stderr new file mode 100644 index 0000000000..bfbf8a10a8 --- /dev/null +++ b/testsuite/tests/backpack/should_fail/bkpfail22.stderr @@ -0,0 +1 @@ +Not working test diff --git a/testsuite/tests/backpack/should_run/Makefile b/testsuite/tests/backpack/should_run/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/backpack/should_run/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/backpack/should_run/all.T b/testsuite/tests/backpack/should_run/all.T new file mode 100644 index 0000000000..b32560059b --- /dev/null +++ b/testsuite/tests/backpack/should_run/all.T @@ -0,0 +1,8 @@ +test('bkprun01', normal, backpack_run, ['']) +test('bkprun02', normal, backpack_run, ['']) +test('bkprun03', normal, backpack_run, ['']) +test('bkprun04', normal, backpack_run, ['']) +test('bkprun05', exit_code(1), backpack_run, ['']) +test('bkprun06', normal, backpack_run, ['']) +test('bkprun07', normal, backpack_run, ['']) +test('bkprun08', normal, backpack_run, ['']) diff --git a/testsuite/tests/backpack/should_run/bkprun01.bkp b/testsuite/tests/backpack/should_run/bkprun01.bkp new file mode 100644 index 0000000000..271990447f --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun01.bkp @@ -0,0 +1,13 @@ +unit p-impls where + module P(hello) where + hello = "Hello " + module Q(hello, world) where + import P + world = "World" + +unit main where + dependency p-impls + module Main where + import P + import Q + main = putStrLn (hello ++ world) diff --git a/testsuite/tests/backpack/should_run/bkprun01.stdout b/testsuite/tests/backpack/should_run/bkprun01.stdout new file mode 100644 index 0000000000..557db03de9 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun01.stdout @@ -0,0 +1 @@ +Hello World diff --git a/testsuite/tests/backpack/should_run/bkprun02.bkp b/testsuite/tests/backpack/should_run/bkprun02.bkp new file mode 100644 index 0000000000..adb174c204 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun02.bkp @@ -0,0 +1,23 @@ +unit p where + signature H where + data T + f :: T -> T + module A where + import H + data A = MkA T + ff :: A -> A + ff (MkA t) = MkA (f t) + +unit q where + module H where + data T = T Int + f (T i) = T (i+1) + +unit main where + dependency q + dependency p[H=q:H] + module Main where + import A + import H + main = case ff (MkA (T 0)) of + MkA (T i) -> print i diff --git a/testsuite/tests/backpack/should_run/bkprun02.stdout b/testsuite/tests/backpack/should_run/bkprun02.stdout new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun02.stdout @@ -0,0 +1 @@ +1 diff --git a/testsuite/tests/backpack/should_run/bkprun03.bkp b/testsuite/tests/backpack/should_run/bkprun03.bkp new file mode 100644 index 0000000000..162ab5af02 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun03.bkp @@ -0,0 +1,25 @@ +unit p where + signature H where + x :: Bool + module PP where + y = False + module P where + import PP + import H + z :: Bool + z = x || y + +unit impls where + module H where + x = False + -- y = True + module H2 where + x = True + +unit main where + dependency impls + dependency p[H=impls:H] (P as P2, PP) + module Main where + import PP + import qualified P2 + main = print P2.z diff --git a/testsuite/tests/backpack/should_run/bkprun03.stdout b/testsuite/tests/backpack/should_run/bkprun03.stdout new file mode 100644 index 0000000000..bc59c12aa1 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun03.stdout @@ -0,0 +1 @@ +False diff --git a/testsuite/tests/backpack/should_run/bkprun04.bkp b/testsuite/tests/backpack/should_run/bkprun04.bkp new file mode 100644 index 0000000000..c6b28999d4 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun04.bkp @@ -0,0 +1,26 @@ +unit p where + signature H where + x :: Bool + module PP where + y = False + module P where + import PP + import H + z :: Bool + z = x || y + +unit impls where + module H where + x = False + y = True + module H2 where + x = True + +unit main where + dependency p[H=impls:H] (P, PP) + dependency p[H=impls:H2] (P as P2) + module Main where + import qualified P + import PP + import qualified P2 + main = print P.z >> print P2.z diff --git a/testsuite/tests/backpack/should_run/bkprun04.stdout b/testsuite/tests/backpack/should_run/bkprun04.stdout new file mode 100644 index 0000000000..91d6f80f27 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun04.stdout @@ -0,0 +1,2 @@ +False +True diff --git a/testsuite/tests/backpack/should_run/bkprun05.bkp b/testsuite/tests/backpack/should_run/bkprun05.bkp new file mode 100644 index 0000000000..25c951e3ff --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun05.bkp @@ -0,0 +1,151 @@ +{-# LANGUAGE RoleAnnotations #-} +unit app where + signature Map where + import Data.Typeable + import Data.Data + import Data.Traversable + import Data.Foldable + import Data.Monoid + import Control.DeepSeq + import Control.Applicative + + infixl 9 !,\\ + + type role Map nominal representational + data Map k a + + instance Functor (Map k) + instance Foldable (Map k) + instance Traversable (Map k) + instance (Eq k, Eq a) => Eq (Map k a) + instance (Data k, Data a, Ord k) => Data (Map k a) + instance (Ord k, Ord v) => Ord (Map k v) + instance (Ord k, Read k, Read e) => Read (Map k e) + instance (Show k, Show a) => Show (Map k a) + instance Ord k => Monoid (Map k v) + instance (NFData k, NFData a) => NFData (Map k a) + + (!) :: Ord k => Map k a -> k -> a + (\\) :: Ord k => Map k a -> Map k b -> Map k a + null :: Map k a -> Bool + size :: Map k a -> Int + member :: Ord k => k -> Map k a -> Bool + notMember :: Ord k => k -> Map k a -> Bool + lookup :: Ord k => k -> Map k a -> Maybe a + findWithDefault :: Ord k => a -> k -> Map k a -> a + lookupLT :: Ord k => k -> Map k v -> Maybe (k, v) + lookupGT :: Ord k => k -> Map k v -> Maybe (k, v) + lookupLE :: Ord k => k -> Map k v -> Maybe (k, v) + lookupGE :: Ord k => k -> Map k v -> Maybe (k, v) + empty :: Map k a + singleton :: k -> a -> Map k a + insert :: Ord k => k -> a -> Map k a -> Map k a + insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a + insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a + insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a) + delete :: Ord k => k -> Map k a -> Map k a + adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a + adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a + update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a + updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a + updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a) + alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a + union :: Ord k => Map k a -> Map k a -> Map k a + unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a + unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a + unions :: Ord k => [Map k a] -> Map k a + unionsWith :: Ord k => (a -> a -> a) -> [Map k a] -> Map k a + difference :: Ord k => Map k a -> Map k b -> Map k a + differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a + differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a + intersection :: Ord k => Map k a -> Map k b -> Map k a + intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c + intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c + mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (Map k a -> Map k c) -> (Map k b -> Map k c) -> Map k a -> Map k b -> Map k c + map :: (a -> b) -> Map k a -> Map k b + mapWithKey :: (k -> a -> b) -> Map k a -> Map k b + traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b) + mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapKeys :: Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a + mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a + mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a + foldr :: (a -> b -> b) -> b -> Map k a -> b + foldl :: (a -> b -> a) -> a -> Map k b -> a + foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b + foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a + foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m + foldr' :: (a -> b -> b) -> b -> Map k a -> b + foldl' :: (a -> b -> a) -> a -> Map k b -> a + foldrWithKey' :: (k -> a -> b -> b) -> b -> Map k a -> b + foldlWithKey' :: (a -> k -> b -> a) -> a -> Map k b -> a + elems :: Map k a -> [a] + keys :: Map k a -> [k] + assocs :: Map k a -> [(k, a)] + toList :: Map k a -> [(k, a)] + fromList :: Ord k => [(k, a)] -> Map k a + fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a + fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a + toAscList :: Map k a -> [(k, a)] + toDescList :: Map k a -> [(k, a)] + fromAscList :: Eq k => [(k, a)] -> Map k a + fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a + fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a + fromDistinctAscList :: [(k, a)] -> Map k a + filter :: (a -> Bool) -> Map k a -> Map k a + filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a + partition :: (a -> Bool) -> Map k a -> (Map k a, Map k a) + partitionWithKey :: (k -> a -> Bool) -> Map k a -> (Map k a, Map k a) + mapMaybe :: (a -> Maybe b) -> Map k a -> Map k b + mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b + mapEither :: (a -> Either b c) -> Map k a -> (Map k b, Map k c) + mapEitherWithKey :: (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c) + split :: Ord k => k -> Map k a -> (Map k a, Map k a) + splitLookup :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) + splitRoot :: Map k b -> [Map k b] + isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool + isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool + isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool + isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool + lookupIndex :: Ord k => k -> Map k a -> Maybe Int + findIndex :: Ord k => k -> Map k a -> Int + elemAt :: Int -> Map k a -> (k, a) + updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a + deleteAt :: Int -> Map k a -> Map k a + findMin :: Map k a -> (k, a) + findMax :: Map k a -> (k, a) + deleteMin :: Map k a -> Map k a + deleteMax :: Map k a -> Map k a + deleteFindMin :: Map k a -> ((k, a), Map k a) + deleteFindMax :: Map k a -> ((k, a), Map k a) + updateMin :: (a -> Maybe a) -> Map k a -> Map k a + updateMax :: (a -> Maybe a) -> Map k a -> Map k a + updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a + updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a + minView :: Map k a -> Maybe (a, Map k a) + maxView :: Map k a -> Maybe (a, Map k a) + minViewWithKey :: Map k a -> Maybe ((k, a), Map k a) + maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a) + showTree :: (Show k, Show a) => Map k a -> String + showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String + valid :: Ord k => Map k a -> Bool + module App where + import Map + app = do + let x = insert 0 "foo" + . delete 1 + . insert 1 undefined + . insert (6 :: Int) "foo" + $ empty + print (member 1 x) + print (toList x) + print x + +unit main where + dependency app[Map=containers:Data.Map.Strict] (App as Strict) + dependency app[Map=containers:Data.Map.Lazy] (App as Lazy) + module Main where + import qualified Strict + import qualified Lazy + main = Lazy.app >> Strict.app diff --git a/testsuite/tests/backpack/should_run/bkprun05.stderr b/testsuite/tests/backpack/should_run/bkprun05.stderr new file mode 100644 index 0000000000..d9042b073d --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun05.stderr @@ -0,0 +1,4 @@ +bkprun05: Prelude.undefined +CallStack (from HasCallStack): + error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err + undefined, called at bkprun05.bkp:138:30 in app+app-9GMmly0OuEYHDXryaGD7sX:App diff --git a/testsuite/tests/driver/sigof02/sigof02.stdout b/testsuite/tests/backpack/should_run/bkprun05.stdout index 687b80c41d..687b80c41d 100644 --- a/testsuite/tests/driver/sigof02/sigof02.stdout +++ b/testsuite/tests/backpack/should_run/bkprun05.stdout diff --git a/testsuite/tests/backpack/should_run/bkprun06.bkp b/testsuite/tests/backpack/should_run/bkprun06.bkp new file mode 100644 index 0000000000..596fa897bc --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun06.bkp @@ -0,0 +1,164 @@ +{-# LANGUAGE RoleAnnotations #-} +unit sigs where + signature Map where + import Data.Typeable + import Data.Data + import Data.Traversable + import Data.Foldable + import Data.Monoid + import Control.DeepSeq + import Control.Applicative + + infixl 9 !,\\ + + type role Map nominal representational + data Map k a + + instance Functor (Map k) + instance Foldable (Map k) + instance Traversable (Map k) + instance (Eq k, Eq a) => Eq (Map k a) + instance (Data k, Data a, Ord k) => Data (Map k a) + instance (Ord k, Ord v) => Ord (Map k v) + instance (Ord k, Read k, Read e) => Read (Map k e) + instance (Show k, Show a) => Show (Map k a) + instance Ord k => Monoid (Map k v) + instance (NFData k, NFData a) => NFData (Map k a) + + (!) :: Ord k => Map k a -> k -> a + (\\) :: Ord k => Map k a -> Map k b -> Map k a + null :: Map k a -> Bool + size :: Map k a -> Int + member :: Ord k => k -> Map k a -> Bool + notMember :: Ord k => k -> Map k a -> Bool + lookup :: Ord k => k -> Map k a -> Maybe a + findWithDefault :: Ord k => a -> k -> Map k a -> a + lookupLT :: Ord k => k -> Map k v -> Maybe (k, v) + lookupGT :: Ord k => k -> Map k v -> Maybe (k, v) + lookupLE :: Ord k => k -> Map k v -> Maybe (k, v) + lookupGE :: Ord k => k -> Map k v -> Maybe (k, v) + empty :: Map k a + singleton :: k -> a -> Map k a + insert :: Ord k => k -> a -> Map k a -> Map k a + insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a + insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a + insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a) + delete :: Ord k => k -> Map k a -> Map k a + adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a + adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a + update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a + updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a + updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a) + alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a + union :: Ord k => Map k a -> Map k a -> Map k a + unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a + unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a + unions :: Ord k => [Map k a] -> Map k a + unionsWith :: Ord k => (a -> a -> a) -> [Map k a] -> Map k a + difference :: Ord k => Map k a -> Map k b -> Map k a + differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a + differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a + intersection :: Ord k => Map k a -> Map k b -> Map k a + intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c + intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c + mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (Map k a -> Map k c) -> (Map k b -> Map k c) -> Map k a -> Map k b -> Map k c + map :: (a -> b) -> Map k a -> Map k b + mapWithKey :: (k -> a -> b) -> Map k a -> Map k b + traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b) + mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) + mapKeys :: Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a + mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a + mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a + foldr :: (a -> b -> b) -> b -> Map k a -> b + foldl :: (a -> b -> a) -> a -> Map k b -> a + foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b + foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a + foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m + foldr' :: (a -> b -> b) -> b -> Map k a -> b + foldl' :: (a -> b -> a) -> a -> Map k b -> a + foldrWithKey' :: (k -> a -> b -> b) -> b -> Map k a -> b + foldlWithKey' :: (a -> k -> b -> a) -> a -> Map k b -> a + elems :: Map k a -> [a] + keys :: Map k a -> [k] + assocs :: Map k a -> [(k, a)] + toList :: Map k a -> [(k, a)] + fromList :: Ord k => [(k, a)] -> Map k a + fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a + fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a + toAscList :: Map k a -> [(k, a)] + toDescList :: Map k a -> [(k, a)] + fromAscList :: Eq k => [(k, a)] -> Map k a + fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a + fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a + fromDistinctAscList :: [(k, a)] -> Map k a + filter :: (a -> Bool) -> Map k a -> Map k a + filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a + partition :: (a -> Bool) -> Map k a -> (Map k a, Map k a) + partitionWithKey :: (k -> a -> Bool) -> Map k a -> (Map k a, Map k a) + mapMaybe :: (a -> Maybe b) -> Map k a -> Map k b + mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b + mapEither :: (a -> Either b c) -> Map k a -> (Map k b, Map k c) + mapEitherWithKey :: (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c) + split :: Ord k => k -> Map k a -> (Map k a, Map k a) + splitLookup :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) + splitRoot :: Map k b -> [Map k b] + isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool + isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool + isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool + isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool + lookupIndex :: Ord k => k -> Map k a -> Maybe Int + findIndex :: Ord k => k -> Map k a -> Int + elemAt :: Int -> Map k a -> (k, a) + updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a + deleteAt :: Int -> Map k a -> Map k a + findMin :: Map k a -> (k, a) + findMax :: Map k a -> (k, a) + deleteMin :: Map k a -> Map k a + deleteMax :: Map k a -> Map k a + deleteFindMin :: Map k a -> ((k, a), Map k a) + deleteFindMax :: Map k a -> ((k, a), Map k a) + updateMin :: (a -> Maybe a) -> Map k a -> Map k a + updateMax :: (a -> Maybe a) -> Map k a -> Map k a + updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a + updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a + minView :: Map k a -> Maybe (a, Map k a) + maxView :: Map k a -> Maybe (a, Map k a) + minViewWithKey :: Map k a -> Maybe ((k, a), Map k a) + maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a) + showTree :: (Show k, Show a) => Map k a -> String + showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String + valid :: Ord k => Map k a -> Bool + + signature MapAsSet where + import Data.Set + + type role Map nominal representational + data Map k a + instance Functor (Map k) + + keysSet :: Map k a -> Set k + fromSet :: (k -> a) -> Set k -> Map k a + +unit app where + dependency sigs[Map=<Map>, MapAsSet=<Map>] + module App where + import Map + + app = do + let x = insert 0 "foo" + . delete 1 + . insert 1 undefined + . insert (6 :: Int) "foo" + $ empty + print (member 1 x) + print (keysSet x) + print (toList x) + print x + +unit main where + dependency app[Map=containers:Data.Map.Lazy] + module Main where + import App + main = app diff --git a/testsuite/tests/driver/sigof02/sigof02d.stdout b/testsuite/tests/backpack/should_run/bkprun06.stdout index 0d0e0f9383..0d0e0f9383 100644 --- a/testsuite/tests/driver/sigof02/sigof02d.stdout +++ b/testsuite/tests/backpack/should_run/bkprun06.stdout diff --git a/testsuite/tests/backpack/should_run/bkprun07.bkp b/testsuite/tests/backpack/should_run/bkprun07.bkp new file mode 100644 index 0000000000..bfd1cdc4ba --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun07.bkp @@ -0,0 +1,32 @@ +unit a where + module A where + data T = T + deriving (Show) + x = True + y = False + mkT = T + class Foo a where + foo :: a -> a + instance Foo Bool where + foo = not +unit bsig where + signature B where + data T + x :: Bool + mkT :: T + class Foo a where + foo :: a -> a + instance Foo Bool + instance Show T + module App where + import B + y = foo x + app = do + print y + print mkT + print (foo y) +unit main where + dependency bsig[B=a:A] + module Main where + import App + main = app diff --git a/testsuite/tests/driver/sigof01/sigof01.stdout b/testsuite/tests/backpack/should_run/bkprun07.stdout index bb614cd2a0..bb614cd2a0 100644 --- a/testsuite/tests/driver/sigof01/sigof01.stdout +++ b/testsuite/tests/backpack/should_run/bkprun07.stdout diff --git a/testsuite/tests/backpack/should_run/bkprun08.bkp b/testsuite/tests/backpack/should_run/bkprun08.bkp new file mode 100644 index 0000000000..022ec52bdc --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun08.bkp @@ -0,0 +1,24 @@ +unit a where + module A where + data T = MkT deriving (Show) + +unit p where + signature ASig1 where + data T + instance Show T + signature ASig2 where + data T + instance Show T + module App where + import qualified ASig1 + import qualified ASig2 + app :: (ASig1.T, ASig2.T) -> IO () + app (t1, t2) = print (show t1, show t2) + +unit main where + dependency p[ASig1=a:A,ASig2=a:A] + dependency a + module Main where + import App + import A + main = app (MkT, MkT) diff --git a/testsuite/tests/backpack/should_run/bkprun08.stdout b/testsuite/tests/backpack/should_run/bkprun08.stdout new file mode 100644 index 0000000000..0281881e29 --- /dev/null +++ b/testsuite/tests/backpack/should_run/bkprun08.stdout @@ -0,0 +1 @@ +("MkT","MkT") diff --git a/testsuite/tests/cabal/cabal03/cabal03.stderr b/testsuite/tests/cabal/cabal03/cabal03.stderr index 9d46d6883c..81b3e4b10b 100644 --- a/testsuite/tests/cabal/cabal03/cabal03.stderr +++ b/testsuite/tests/cabal/cabal03/cabal03.stderr @@ -1,4 +1,3 @@ -Setup: The following installed packages are broken because other packages they -depend on are missing. These broken packages must be rebuilt before they can -be used. -package q-1.0 is broken due to missing package p-noopt +Setup: The following packages are broken because other packages they depend on +are missing. These broken packages must be rebuilt before they can be used. +installed package q-1.0 is broken due to missing package p-noopt diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile index 617510eec4..a97b5765e3 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile @@ -7,10 +7,10 @@ checkExists = [ -f $1 ] || echo $1 missing .PHONY: dynamicToo005 # Check that "-c -dynamic-too" works with .hsig dynamicToo005: - "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ - -sig-of A005=base:Prelude \ - -c A005.hsig - $(call checkExists,A005.o) - $(call checkExists,A005.hi) - $(call checkExists,A005.dyn_o) - $(call checkExists,A005.dyn_hi) + "$(TEST_HC)" $(TEST_HC_OPTS) --backpack dynamicToo005.bkp -dynamic-too -v0 + $(call checkExists,sig/A005.hi) + $(call checkExists,sig/A005.dyn_hi) + $(call checkExists,sig/sig-*/A005.o) + $(call checkExists,sig/sig-*/A005.hi) + $(call checkExists,sig/sig-*/A005.dyn_o) + $(call checkExists,sig/sig-*/A005.dyn_hi) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/dynamicToo005.bkp b/testsuite/tests/driver/dynamicToo/dynamicToo005/dynamicToo005.bkp new file mode 100644 index 0000000000..1f3a6c1135 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/dynamicToo005.bkp @@ -0,0 +1,6 @@ +unit sig where + signature A005 where + data Maybe a = Nothing | Just a + +unit inst where + dependency sig[A005=base:Prelude] diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig deleted file mode 100644 index f79d5d334f..0000000000 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig +++ /dev/null @@ -1,5 +0,0 @@ - -module A where - -data Maybe a = Nothing | Just a - diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs b/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs deleted file mode 100644 index 65900e786a..0000000000 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} - -module B where - -import A - -b :: Maybe a -b = Nothing diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile deleted file mode 100644 index 497f2c0942..0000000000 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -checkExists = [ -f $1 ] || echo $1 missing - -.PHONY: dynamicToo006 -# Check that "--make -dynamic-too" works with .hsig -dynamicToo006: - "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ - -sig-of A=base:Prelude \ - --make B - $(call checkExists,A.o) - $(call checkExists,B.o) - $(call checkExists,A.hi) - $(call checkExists,B.hi) - $(call checkExists,A.dyn_o) - $(call checkExists,B.dyn_o) - $(call checkExists,A.dyn_hi) - $(call checkExists,B.dyn_hi) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T deleted file mode 100644 index 72e06ca524..0000000000 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T +++ /dev/null @@ -1,9 +0,0 @@ - -test('dynamicToo006', - [extra_clean(['A.o', 'A.hi', 'A.dyn_o', 'A.dyn_hi', - 'B.o', 'B.hi', 'B.dyn_o', 'B.dyn_hi']), - unless(have_vanilla(), skip), - unless(have_dynamic(), skip)], - run_command, - ['$MAKE -s --no-print-directory dynamicToo006']) - diff --git a/testsuite/tests/driver/recomp005/recomp005.stdout b/testsuite/tests/driver/recomp005/recomp005.stdout index ad1ef6d170..6e2581ed04 100644 --- a/testsuite/tests/driver/recomp005/recomp005.stdout +++ b/testsuite/tests/driver/recomp005/recomp005.stdout @@ -1,5 +1,5 @@ -[1 of 5] Compiling B ( B.hs, B.o ) -[2 of 5] Compiling A ( A.hs, A.o ) +[1 of 5] Compiling A ( A.hs, A.o ) +[2 of 5] Compiling B ( B.hs, B.o ) [3 of 5] Compiling C ( C.hs, C.o ) [4 of 5] Compiling D ( D.hs, D.o ) [5 of 5] Compiling E ( E.hs, E.o ) diff --git a/testsuite/tests/driver/sigof01/A.hs b/testsuite/tests/driver/sigof01/A.hs deleted file mode 100644 index 644432a283..0000000000 --- a/testsuite/tests/driver/sigof01/A.hs +++ /dev/null @@ -1,10 +0,0 @@ -module A where -data T = T - deriving (Show) -x = True -y = False -mkT = T -class Foo a where - foo :: a -> a -instance Foo Bool where - foo = not diff --git a/testsuite/tests/driver/sigof01/B.hsig b/testsuite/tests/driver/sigof01/B.hsig deleted file mode 100644 index 289d3bcb18..0000000000 --- a/testsuite/tests/driver/sigof01/B.hsig +++ /dev/null @@ -1,6 +0,0 @@ -module B where -data T -x :: Bool -mkT :: T -class Foo a where - foo :: a -> a diff --git a/testsuite/tests/driver/sigof01/Main.hs b/testsuite/tests/driver/sigof01/Main.hs deleted file mode 100644 index c90cfaf1db..0000000000 --- a/testsuite/tests/driver/sigof01/Main.hs +++ /dev/null @@ -1,6 +0,0 @@ -import B -y = foo x -main = do - print y - print mkT - print (foo y) diff --git a/testsuite/tests/driver/sigof01/Makefile b/testsuite/tests/driver/sigof01/Makefile deleted file mode 100644 index aadff83b99..0000000000 --- a/testsuite/tests/driver/sigof01/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -S01_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof01 -i -itmp_sigof01 -sigof01: - rm -rf tmp_sigof01 - mkdir tmp_sigof01 - '$(TEST_HC)' $(S01_OPTS) -c A.hs - '$(TEST_HC)' $(S01_OPTS) -c B.hsig -sig-of "B is main:A" - '$(TEST_HC)' $(S01_OPTS) -c Main.hs - '$(TEST_HC)' $(S01_OPTS) tmp_sigof01/A.o tmp_sigof01/Main.o -o tmp_sigof01/Main - tmp_sigof01/Main - -sigof01m: - rm -rf tmp_sigof01m - mkdir tmp_sigof01m - '$(TEST_HC)' $(TEST_HC_OPTS) -outputdir tmp_sigof01m --make Main.hs -sig-of "B is main:A" -o tmp_sigof01m/Main - tmp_sigof01m/Main diff --git a/testsuite/tests/driver/sigof01/all.T b/testsuite/tests/driver/sigof01/all.T deleted file mode 100644 index 61a012d264..0000000000 --- a/testsuite/tests/driver/sigof01/all.T +++ /dev/null @@ -1,9 +0,0 @@ -test('sigof01', - [ clean_cmd('rm -rf tmp_sigof01') ], - run_command, - ['$MAKE -s --no-print-directory sigof01']) - -test('sigof01m', - [ expect_broken(12189), clean_cmd('rm -rf tmp_sigof01m'), normalise_slashes ], - run_command, - ['$MAKE -s --no-print-directory sigof01m']) diff --git a/testsuite/tests/driver/sigof01/sigof01m.stdout b/testsuite/tests/driver/sigof01/sigof01m.stdout deleted file mode 100644 index a7fdd8298e..0000000000 --- a/testsuite/tests/driver/sigof01/sigof01m.stdout +++ /dev/null @@ -1,7 +0,0 @@ -[1 of 3] Compiling A ( A.hs, tmp_sigof01m/A.o ) -[2 of 3] Compiling B[sig of A] ( B.hsig, nothing ) -[3 of 3] Compiling Main ( Main.hs, tmp_sigof01m/Main.o ) -Linking tmp_sigof01m/Main ... -False -T -True diff --git a/testsuite/tests/driver/sigof02/Double.hs b/testsuite/tests/driver/sigof02/Double.hs deleted file mode 100644 index 8111b1cc0f..0000000000 --- a/testsuite/tests/driver/sigof02/Double.hs +++ /dev/null @@ -1,13 +0,0 @@ -import Map -import MapAsSet - -main = do - let x = insert 0 "foo" - . delete 1 - . insert 1 undefined - . insert (6 :: Int) "foo" - $ empty - print (member 1 x) - print (keysSet x) - print (toList x) - print x diff --git a/testsuite/tests/driver/sigof02/Main.hs b/testsuite/tests/driver/sigof02/Main.hs deleted file mode 100644 index b6f41da773..0000000000 --- a/testsuite/tests/driver/sigof02/Main.hs +++ /dev/null @@ -1,11 +0,0 @@ -import Map - -main = do - let x = insert 0 "foo" - . delete 1 - . insert 1 undefined - . insert (6 :: Int) "foo" - $ empty - print (member 1 x) - print (toList x) - print x diff --git a/testsuite/tests/driver/sigof02/Makefile b/testsuite/tests/driver/sigof02/Makefile deleted file mode 100644 index 5db1628a6a..0000000000 --- a/testsuite/tests/driver/sigof02/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -S02_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof02 -i -itmp_sigof02 -sigof02: - rm -rf tmp_sigof02 - mkdir tmp_sigof02 - '$(GHC_PKG)' field containers key | sed 's/^.*: *//' > tmp_sigof02/containers - '$(TEST_HC)' $(S02_OPTS) -c Map.hsig -sig-of "Map is `cat tmp_sigof02/containers`:Data.Map.Strict" - '$(TEST_HC)' $(S02_OPTS) -c Main.hs - '$(TEST_HC)' $(S02_OPTS) -package containers tmp_sigof02/Main.o -o tmp_sigof02/StrictMain - ! ./tmp_sigof02/StrictMain - '$(TEST_HC)' $(S02_OPTS) -c Map.hsig -sig-of "Map is `cat tmp_sigof02/containers`:Data.Map.Lazy" - '$(TEST_HC)' $(S02_OPTS) -c Main.hs - '$(TEST_HC)' $(S02_OPTS) -package containers tmp_sigof02/Main.o -o tmp_sigof02/LazyMain - ./tmp_sigof02/LazyMain - -S02T_OPTS=$(TEST_HC_OPTS) -fno-code -fwrite-interface -outputdir tmp_sigof02t -i -itmp_sigof02t -sigof02t: - rm -rf tmp_sigof02t - mkdir tmp_sigof02t - '$(TEST_HC)' $(S02T_OPTS) -c Map.hsig - '$(TEST_HC)' $(S02T_OPTS) -c Main.hs - -S02M_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof02m -sigof02m: - rm -rf tmp_sigof02m - mkdir tmp_sigof02m - '$(GHC_PKG)' field containers key | sed 's/^.*: *//' > tmp_sigof02m/containers - '$(TEST_HC)' $(S02M_OPTS) --make Main.hs -sig-of "Map is `cat tmp_sigof02m/containers`:Data.Map.Strict" -o tmp_sigof02m/StrictMain - ! ./tmp_sigof02m/StrictMain - '$(TEST_HC)' $(S02M_OPTS) --make Main.hs -sig-of "Map is `cat tmp_sigof02m/containers`:Data.Map.Lazy" -o tmp_sigof02m/LazyMain - ./tmp_sigof02m/LazyMain - -sigof02mt: - rm -rf tmp_sigof02mt - mkdir tmp_sigof02mt - '$(TEST_HC)' $(TEST_HC_OPTS) -outputdir tmp_sigof02mt --make Main.hs -fno-code -fwrite-interface - -S02D_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof02d -i -itmp_sigof02d -sigof02d: - rm -rf tmp_sigof02d - mkdir tmp_sigof02d - '$(GHC_PKG)' field containers key | sed 's/^.*: *//' > tmp_sigof02d/containers - '$(TEST_HC)' $(S02D_OPTS) -c Map.hsig -sig-of "Map is `cat tmp_sigof02d/containers`:Data.Map.Lazy, MapAsSet is `cat tmp_sigof02d/containers`:Data.Map.Lazy" - '$(TEST_HC)' $(S02D_OPTS) -c MapAsSet.hsig -sig-of "Map is `cat tmp_sigof02d/containers`:Data.Map.Lazy, MapAsSet is `cat tmp_sigof02d/containers`:Data.Map.Lazy" - '$(TEST_HC)' $(S02D_OPTS) -c Double.hs - '$(TEST_HC)' $(S02D_OPTS) -package containers tmp_sigof02d/Main.o -o tmp_sigof02d/Double - ./tmp_sigof02d/Double - -S02DT_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof02dt -i -itmp_sigof02dt -fno-code -fwrite-interface -sigof02dt: - rm -rf tmp_sigof02dt - mkdir tmp_sigof02dt - '$(TEST_HC)' $(S02DT_OPTS) -c Map.hsig - '$(TEST_HC)' $(S02DT_OPTS) -c MapAsSet.hsig - ! '$(TEST_HC)' $(S02DT_OPTS) -c Double.hs - -sigof02dm: - rm -rf tmp_sigof02dm - mkdir tmp_sigof02dm - '$(GHC_PKG)' field containers key | sed 's/^.*: *//' > tmp_sigof02dm/containers - '$(TEST_HC)' $(TEST_HC_OPTS) -outputdir tmp_sigof02dm --make Double.hs -sig-of "Map is `cat tmp_sigof02dm/containers`:Data.Map.Lazy, MapAsSet is `cat tmp_sigof02dm/containers`:Data.Map.Lazy" -o tmp_sigof02dm/Double - ./tmp_sigof02dm/Double - -sigof02dmt: - rm -rf tmp_sigof02dmt - mkdir tmp_sigof02dmt - # doesn't typecheck due to lack of alias - ! '$(TEST_HC)' $(TEST_HC_OPTS) -outputdir tmp_sigof02dmt -fno-code -fwrite-interface --make Double.hs -o tmp_sigof02dmt/Double diff --git a/testsuite/tests/driver/sigof02/Map.hsig b/testsuite/tests/driver/sigof02/Map.hsig deleted file mode 100644 index 8e46f1d63f..0000000000 --- a/testsuite/tests/driver/sigof02/Map.hsig +++ /dev/null @@ -1,132 +0,0 @@ -{-# LANGUAGE RoleAnnotations #-} -module Map where - -import Data.Typeable -import Data.Data -import Data.Traversable -import Data.Foldable -import Data.Monoid -import Control.DeepSeq -import Control.Applicative - -infixl 9 !,\\ - -type role Map nominal representational -data Map k a - -instance Functor (Map k) -instance Foldable (Map k) -instance Traversable (Map k) -instance (Eq k, Eq a) => Eq (Map k a) -instance (Data k, Data a, Ord k) => Data (Map k a) -instance (Ord k, Ord v) => Ord (Map k v) -instance (Ord k, Read k, Read e) => Read (Map k e) -instance (Show k, Show a) => Show (Map k a) -instance Ord k => Monoid (Map k v) -instance (NFData k, NFData a) => NFData (Map k a) - -(!) :: Ord k => Map k a -> k -> a -(\\) :: Ord k => Map k a -> Map k b -> Map k a -null :: Map k a -> Bool -size :: Map k a -> Int -member :: Ord k => k -> Map k a -> Bool -notMember :: Ord k => k -> Map k a -> Bool -lookup :: Ord k => k -> Map k a -> Maybe a -findWithDefault :: Ord k => a -> k -> Map k a -> a -lookupLT :: Ord k => k -> Map k v -> Maybe (k, v) -lookupGT :: Ord k => k -> Map k v -> Maybe (k, v) -lookupLE :: Ord k => k -> Map k v -> Maybe (k, v) -lookupGE :: Ord k => k -> Map k v -> Maybe (k, v) -empty :: Map k a -singleton :: k -> a -> Map k a -insert :: Ord k => k -> a -> Map k a -> Map k a -insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a -insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a -insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a) -delete :: Ord k => k -> Map k a -> Map k a -adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a -adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a -update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a -updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a -updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a) -alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a -union :: Ord k => Map k a -> Map k a -> Map k a -unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a -unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a -unions :: Ord k => [Map k a] -> Map k a -unionsWith :: Ord k => (a -> a -> a) -> [Map k a] -> Map k a -difference :: Ord k => Map k a -> Map k b -> Map k a -differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a -differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a -intersection :: Ord k => Map k a -> Map k b -> Map k a -intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c -intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c -mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (Map k a -> Map k c) -> (Map k b -> Map k c) -> Map k a -> Map k b -> Map k c -map :: (a -> b) -> Map k a -> Map k b -mapWithKey :: (k -> a -> b) -> Map k a -> Map k b -traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b) -mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) -mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) -mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c) -mapKeys :: Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a -mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a -mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a -foldr :: (a -> b -> b) -> b -> Map k a -> b -foldl :: (a -> b -> a) -> a -> Map k b -> a -foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b -foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a -foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m -foldr' :: (a -> b -> b) -> b -> Map k a -> b -foldl' :: (a -> b -> a) -> a -> Map k b -> a -foldrWithKey' :: (k -> a -> b -> b) -> b -> Map k a -> b -foldlWithKey' :: (a -> k -> b -> a) -> a -> Map k b -> a -elems :: Map k a -> [a] -keys :: Map k a -> [k] -assocs :: Map k a -> [(k, a)] -toList :: Map k a -> [(k, a)] -fromList :: Ord k => [(k, a)] -> Map k a -fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a -fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a -toAscList :: Map k a -> [(k, a)] -toDescList :: Map k a -> [(k, a)] -fromAscList :: Eq k => [(k, a)] -> Map k a -fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a -fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a -fromDistinctAscList :: [(k, a)] -> Map k a -filter :: (a -> Bool) -> Map k a -> Map k a -filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a -partition :: (a -> Bool) -> Map k a -> (Map k a, Map k a) -partitionWithKey :: (k -> a -> Bool) -> Map k a -> (Map k a, Map k a) -mapMaybe :: (a -> Maybe b) -> Map k a -> Map k b -mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b -mapEither :: (a -> Either b c) -> Map k a -> (Map k b, Map k c) -mapEitherWithKey :: (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c) -split :: Ord k => k -> Map k a -> (Map k a, Map k a) -splitLookup :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) -splitRoot :: Map k b -> [Map k b] -isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool -isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool -isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool -isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool -lookupIndex :: Ord k => k -> Map k a -> Maybe Int -findIndex :: Ord k => k -> Map k a -> Int -elemAt :: Int -> Map k a -> (k, a) -updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a -deleteAt :: Int -> Map k a -> Map k a -findMin :: Map k a -> (k, a) -findMax :: Map k a -> (k, a) -deleteMin :: Map k a -> Map k a -deleteMax :: Map k a -> Map k a -deleteFindMin :: Map k a -> ((k, a), Map k a) -deleteFindMax :: Map k a -> ((k, a), Map k a) -updateMin :: (a -> Maybe a) -> Map k a -> Map k a -updateMax :: (a -> Maybe a) -> Map k a -> Map k a -updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a -updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a -minView :: Map k a -> Maybe (a, Map k a) -maxView :: Map k a -> Maybe (a, Map k a) -minViewWithKey :: Map k a -> Maybe ((k, a), Map k a) -maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a) -showTree :: (Show k, Show a) => Map k a -> String -showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String -valid :: Ord k => Map k a -> Bool diff --git a/testsuite/tests/driver/sigof02/MapAsSet.hsig b/testsuite/tests/driver/sigof02/MapAsSet.hsig deleted file mode 100644 index 1defbc7717..0000000000 --- a/testsuite/tests/driver/sigof02/MapAsSet.hsig +++ /dev/null @@ -1,11 +0,0 @@ -{-# LANGUAGE RoleAnnotations #-} -module MapAsSet where - -import Data.Set - -type role Map nominal representational -data Map k a -instance Functor (Map k) - -keysSet :: Map k a -> Set k -fromSet :: (k -> a) -> Set k -> Map k a diff --git a/testsuite/tests/driver/sigof02/all.T b/testsuite/tests/driver/sigof02/all.T deleted file mode 100644 index 76cec88040..0000000000 --- a/testsuite/tests/driver/sigof02/all.T +++ /dev/null @@ -1,41 +0,0 @@ -test('sigof02', - [ clean_cmd('rm -rf tmp_sigof02') ], - run_command, - ['$MAKE -s --no-print-directory sigof02']) - -test('sigof02t', - [ clean_cmd('rm -rf tmp_sigof02t') ], - run_command, - ['$MAKE -s --no-print-directory sigof02t']) - -test('sigof02m', - [ clean_cmd('rm -rf tmp_sigof02m'), normalise_slashes ], - run_command, - ['$MAKE -s --no-print-directory sigof02m']) - -test('sigof02mt', - [ clean_cmd('rm -rf tmp_sigof02mt') ], - run_command, - ['$MAKE -s --no-print-directory sigof02mt']) - -test('sigof02d', - [ clean_cmd('rm -rf tmp_sigof02d') ], - run_command, - ['$MAKE -s --no-print-directory sigof02d']) - -test('sigof02dt', - [ clean_cmd('rm -rf tmp_sigof02dt') ], - run_command, - ['$MAKE -s --no-print-directory sigof02dt']) - - -test('sigof02dm', - [ clean_cmd('rm -rf tmp_sigof02dm'), normalise_slashes ], - run_command, - ['$MAKE -s --no-print-directory sigof02dm']) - -test('sigof02dmt', - [ clean_cmd('rm -rf tmp_sigof02dmt') ], - run_command, - ['$MAKE -s --no-print-directory sigof02dmt']) - diff --git a/testsuite/tests/driver/sigof02/sigof02.stderr b/testsuite/tests/driver/sigof02/sigof02.stderr deleted file mode 100644 index 0fb77f6f9b..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02.stderr +++ /dev/null @@ -1,4 +0,0 @@ -StrictMain: Prelude.undefined -CallStack (from ImplicitParams): - error, called at libraries/base/GHC/Err.hs:43:14 in base:GHC.Err - undefined, called at Main.hs:6:22 in main:Main diff --git a/testsuite/tests/driver/sigof02/sigof02dm.stdout b/testsuite/tests/driver/sigof02/sigof02dm.stdout deleted file mode 100644 index 14ee83789b..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02dm.stdout +++ /dev/null @@ -1,8 +0,0 @@ -[1 of 3] Compiling MapAsSet[sig of Data.Map.Lazy] ( MapAsSet.hsig, nothing ) -[2 of 3] Compiling Map[sig of Data.Map.Lazy] ( Map.hsig, nothing ) -[3 of 3] Compiling Main ( Double.hs, tmp_sigof02dm/Main.o ) -Linking tmp_sigof02dm/Double ... -False -fromList [0,6] -[(0,"foo"),(6,"foo")] -fromList [(0,"foo"),(6,"foo")] diff --git a/testsuite/tests/driver/sigof02/sigof02dmt.stderr b/testsuite/tests/driver/sigof02/sigof02dmt.stderr deleted file mode 100644 index 389c7b7600..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02dmt.stderr +++ /dev/null @@ -1,9 +0,0 @@ - -Double.hs:11:20: error: - • Couldn't match expected type ‘MapAsSet.Map k0 a0’ - with actual type ‘Map.Map Int [Char]’ - NB: ‘Map.Map’ is defined at Map.hsig:15:1-12 - ‘MapAsSet.Map’ is defined at MapAsSet.hsig:7:1-12 - • In the first argument of ‘keysSet’, namely ‘x’ - In the first argument of ‘print’, namely ‘(keysSet x)’ - In a stmt of a 'do' block: print (keysSet x) diff --git a/testsuite/tests/driver/sigof02/sigof02dmt.stdout b/testsuite/tests/driver/sigof02/sigof02dmt.stdout deleted file mode 100644 index 5df6557883..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02dmt.stdout +++ /dev/null @@ -1,3 +0,0 @@ -[1 of 3] Compiling MapAsSet[abstract sig] ( MapAsSet.hsig, nothing ) -[2 of 3] Compiling Map[abstract sig] ( Map.hsig, nothing ) -[3 of 3] Compiling Main ( Double.hs, nothing ) diff --git a/testsuite/tests/driver/sigof02/sigof02dt.stderr b/testsuite/tests/driver/sigof02/sigof02dt.stderr deleted file mode 100644 index 5b23583043..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02dt.stderr +++ /dev/null @@ -1,9 +0,0 @@ - -Double.hs:11:20: error: - • Couldn't match expected type ‘MapAsSet.Map k0 a0’ - with actual type ‘Map.Map Int [Char]’ - NB: ‘Map.Map’ is defined in ‘Map’ - ‘MapAsSet.Map’ is defined in ‘MapAsSet’ - • In the first argument of ‘keysSet’, namely ‘x’ - In the first argument of ‘print’, namely ‘(keysSet x)’ - In a stmt of a 'do' block: print (keysSet x) diff --git a/testsuite/tests/driver/sigof02/sigof02m.stderr b/testsuite/tests/driver/sigof02/sigof02m.stderr deleted file mode 100644 index 0fb77f6f9b..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02m.stderr +++ /dev/null @@ -1,4 +0,0 @@ -StrictMain: Prelude.undefined -CallStack (from ImplicitParams): - error, called at libraries/base/GHC/Err.hs:43:14 in base:GHC.Err - undefined, called at Main.hs:6:22 in main:Main diff --git a/testsuite/tests/driver/sigof02/sigof02m.stdout b/testsuite/tests/driver/sigof02/sigof02m.stdout deleted file mode 100644 index 41cc4a7bb3..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02m.stdout +++ /dev/null @@ -1,9 +0,0 @@ -[1 of 2] Compiling Map[sig of Data.Map.Strict] ( Map.hsig, nothing ) -[2 of 2] Compiling Main ( Main.hs, tmp_sigof02m/Main.o ) -Linking tmp_sigof02m/StrictMain ... -[1 of 2] Compiling Map[sig of Data.Map.Lazy] ( Map.hsig, nothing ) [sig-of changed] -[2 of 2] Compiling Main ( Main.hs, tmp_sigof02m/Main.o ) [Map changed] -Linking tmp_sigof02m/LazyMain ... -False -[(0,"foo"),(6,"foo")] -fromList [(0,"foo"),(6,"foo")] diff --git a/testsuite/tests/driver/sigof02/sigof02mt.stdout b/testsuite/tests/driver/sigof02/sigof02mt.stdout deleted file mode 100644 index dd7a193aea..0000000000 --- a/testsuite/tests/driver/sigof02/sigof02mt.stdout +++ /dev/null @@ -1,2 +0,0 @@ -[1 of 2] Compiling Map[abstract sig] ( Map.hsig, nothing ) -[2 of 2] Compiling Main ( Main.hs, nothing ) diff --git a/testsuite/tests/driver/sigof03/A.hs b/testsuite/tests/driver/sigof03/A.hs deleted file mode 100644 index 67435f038c..0000000000 --- a/testsuite/tests/driver/sigof03/A.hs +++ /dev/null @@ -1,3 +0,0 @@ -module A where -class C a where -instance C Bool where diff --git a/testsuite/tests/driver/sigof03/ASig1.hsig b/testsuite/tests/driver/sigof03/ASig1.hsig deleted file mode 100644 index 9428e0cf04..0000000000 --- a/testsuite/tests/driver/sigof03/ASig1.hsig +++ /dev/null @@ -1,3 +0,0 @@ -module ASig1 where -class C a -instance C Bool diff --git a/testsuite/tests/driver/sigof03/ASig2.hsig b/testsuite/tests/driver/sigof03/ASig2.hsig deleted file mode 100644 index 6f278b0a89..0000000000 --- a/testsuite/tests/driver/sigof03/ASig2.hsig +++ /dev/null @@ -1,3 +0,0 @@ -module ASig2 where -class C a -instance C Bool diff --git a/testsuite/tests/driver/sigof03/Main.hs b/testsuite/tests/driver/sigof03/Main.hs deleted file mode 100644 index 9aae9cc798..0000000000 --- a/testsuite/tests/driver/sigof03/Main.hs +++ /dev/null @@ -1,3 +0,0 @@ -import ASig1 -import ASig2 -main = return () diff --git a/testsuite/tests/driver/sigof03/Makefile b/testsuite/tests/driver/sigof03/Makefile deleted file mode 100644 index 338d8d4fe2..0000000000 --- a/testsuite/tests/driver/sigof03/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -S03_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof03 -i -itmp_sigof03 -sigof03: - rm -rf tmp_sigof03 - mkdir tmp_sigof03 - '$(TEST_HC)' $(S03_OPTS) -c A.hs - '$(TEST_HC)' $(S03_OPTS) -c ASig1.hsig -sig-of "ASig1 is main:A, ASig2 is main:A" - '$(TEST_HC)' $(S03_OPTS) -c ASig2.hsig -sig-of "ASig1 is main:A, ASig2 is main:A" - '$(TEST_HC)' $(S03_OPTS) -c Main.hs - '$(TEST_HC)' $(S03_OPTS) tmp_sigof03/A.o tmp_sigof03/Main.o -o tmp_sigof03/Main - ./tmp_sigof03/Main - -S03M_OPTS=$(TEST_HC_OPTS) -outputdir tmp_sigof03m -sigof03m: - rm -rf tmp_sigof03m - mkdir tmp_sigof03m - '$(TEST_HC)' $(S03M_OPTS) --make Main.hs -sig-of "ASig1 is main:A, ASig2 is main:A" - ./tmp_sigof03m/Main - -# Currently, the type-check tests are omitted, because we don't have a -# way of telling GHC that ASig1 and ASig2 have the same identities -# (sig-of is not right because it requires the target to have an hi -# file, but in general we won't have it.) diff --git a/testsuite/tests/driver/sigof03/all.T b/testsuite/tests/driver/sigof03/all.T deleted file mode 100644 index a1435089d4..0000000000 --- a/testsuite/tests/driver/sigof03/all.T +++ /dev/null @@ -1,11 +0,0 @@ -test('sigof03', - [ clean_cmd('rm -rf tmp_sigof03') ], - run_command, - ['$MAKE -s --no-print-directory sigof03']) - -# This doesn't work yet, because the instances aren't found the -# right way (they don't go in the EPS, differently from one-shot) -test('sigof03m', - [ clean_cmd('rm -rf tmp_sigof03m'), expect_broken(9252) ], - run_command, - ['$MAKE -s --no-print-directory sigof03m']) diff --git a/testsuite/tests/driver/sigof04/Makefile b/testsuite/tests/driver/sigof04/Makefile deleted file mode 100644 index 0c1e754394..0000000000 --- a/testsuite/tests/driver/sigof04/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -clean: - rm -rf containers - -sigof04: - '$(GHC_PKG)' field containers key | sed 's/^.*: *//' > containers - ! '$(TEST_HC)' $(TEST_HC_OPTS) -c Sig.hsig -sig-of "Sig is `cat containers`:Data.Map.Strict" diff --git a/testsuite/tests/driver/sigof04/Sig.hsig b/testsuite/tests/driver/sigof04/Sig.hsig deleted file mode 100644 index 3110f28fff..0000000000 --- a/testsuite/tests/driver/sigof04/Sig.hsig +++ /dev/null @@ -1,2 +0,0 @@ -module Sig(insert) where -import Data.Map.Lazy (insert) diff --git a/testsuite/tests/driver/sigof04/all.T b/testsuite/tests/driver/sigof04/all.T deleted file mode 100644 index 7844bf8a69..0000000000 --- a/testsuite/tests/driver/sigof04/all.T +++ /dev/null @@ -1,4 +0,0 @@ -test('sigof04', - [ clean_cmd('$MAKE -s clean') ], - run_command, - ['$MAKE -s --no-print-directory sigof04']) diff --git a/testsuite/tests/driver/sigof04/sigof04.stderr b/testsuite/tests/driver/sigof04/sigof04.stderr deleted file mode 100644 index 14e631128c..0000000000 --- a/testsuite/tests/driver/sigof04/sigof04.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -<no location info>: error: - ‘insert’ is exported by the hsig file, but not exported by the module diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr index cafb6a4992..ec3c66c8b6 100644 --- a/testsuite/tests/ghci/scripts/T5979.stderr +++ b/testsuite/tests/ghci/scripts/T5979.stderr @@ -2,6 +2,6 @@ <no location info>: error: Could not find module ‘Control.Monad.Trans.State’ Perhaps you meant - Control.Monad.Trans.State (from transformers-0.4.3.0@transformers-0.4.3.0) - Control.Monad.Trans.Class (from transformers-0.4.3.0@transformers-0.4.3.0) - Control.Monad.Trans.Cont (from transformers-0.4.3.0@transformers-0.4.3.0) + Control.Monad.Trans.State (from transformers-0.5.2.0) + Control.Monad.Trans.Class (from transformers-0.5.2.0) + Control.Monad.Trans.Cont (from transformers-0.5.2.0) diff --git a/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr b/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr index 77286daf62..c2994dc1a5 100644 --- a/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr +++ b/testsuite/tests/haddock/haddock_examples/haddock.Test.stderr @@ -1,17 +1,17 @@ -[1 of 3] Compiling Visible ( Visible.hs, Visible.o ) +[1 of 3] Compiling Hidden ( Hidden.hs, Hidden.o ) ==================== Parser ==================== -module Visible where -visible :: Int -> Int -visible a = a +module Hidden where +hidden :: Int -> Int +hidden a = a -[2 of 3] Compiling Hidden ( Hidden.hs, Hidden.o ) +[2 of 3] Compiling Visible ( Visible.hs, Visible.o ) ==================== Parser ==================== -module Hidden where -hidden :: Int -> Int -hidden a = a +module Visible where +visible :: Int -> Int +visible a = a [3 of 3] Compiling Test ( Test.hs, Test.o ) diff --git a/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr b/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr index 26b8daa53d..2a107d6570 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr @@ -1,10 +1,10 @@ -[1 of 3] Compiling T11167_ambiguous_fixity_B ( T11167_ambiguous_fixity_B.hs, T11167_ambiguous_fixity_B.o ) -[2 of 3] Compiling T11167_ambiguous_fixity_A ( T11167_ambiguous_fixity_A.hs, T11167_ambiguous_fixity_A.o ) +[1 of 3] Compiling T11167_ambiguous_fixity_A ( T11167_ambiguous_fixity_A.hs, T11167_ambiguous_fixity_A.o ) +[2 of 3] Compiling T11167_ambiguous_fixity_B ( T11167_ambiguous_fixity_B.hs, T11167_ambiguous_fixity_B.o ) [3 of 3] Compiling T11167_ambiguous_fixity ( T11167_ambiguous_fixity.hs, T11167_ambiguous_fixity.o ) T11167_ambiguous_fixity.hs:6:7: error: Ambiguous fixity for record field ‘foo’ - Conflicts: + Conflicts: infixr 3 imported from ‘T11167_ambiguous_fixity_A’ at T11167_ambiguous_fixity.hs:3:1-32 (and originally defined at T11167_ambiguous_fixity_A.hs:4:16-18) diff --git a/testsuite/tests/package/package07e.stderr b/testsuite/tests/package/package07e.stderr index 0e4a0407ca..8de07f99b2 100644 --- a/testsuite/tests/package/package07e.stderr +++ b/testsuite/tests/package/package07e.stderr @@ -1,21 +1,16 @@ -package07e.hs:2:1: +package07e.hs:2:1: error: Failed to load interface for ‘MyHsTypes’ - Perhaps you meant - HsTypes (needs flag -package-key ghc-<VERSION>) Use -v to see a list of the files searched for. -package07e.hs:3:1: +package07e.hs:3:1: error: Failed to load interface for ‘HsTypes’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. -package07e.hs:4:1: +package07e.hs:4:1: error: Failed to load interface for ‘HsUtils’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. -package07e.hs:5:1: +package07e.hs:5:1: error: Failed to load interface for ‘UniqFM’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. diff --git a/testsuite/tests/package/package08e.stderr b/testsuite/tests/package/package08e.stderr index 975b4b9873..c5017350f0 100644 --- a/testsuite/tests/package/package08e.stderr +++ b/testsuite/tests/package/package08e.stderr @@ -1,21 +1,16 @@ -package08e.hs:2:1: +package08e.hs:2:1: error: Failed to load interface for ‘MyHsTypes’ - Perhaps you meant - HsTypes (needs flag -package-key ghc-<VERSION>) Use -v to see a list of the files searched for. -package08e.hs:3:1: +package08e.hs:3:1: error: Failed to load interface for ‘HsTypes’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. -package08e.hs:4:1: +package08e.hs:4:1: error: Failed to load interface for ‘HsUtils’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. -package08e.hs:5:1: +package08e.hs:5:1: error: Failed to load interface for ‘UniqFM’ - It is a member of the hidden package ‘ghc-<VERSION>’. Use -v to see a list of the files searched for. diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index 10144f2d8e..ec2cce1c9b 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -52,7 +52,7 @@ test('haddock.base', test('haddock.Cabal', [unless(in_tree_compiler(), skip), req_haddock ,stats_num_field('bytes allocated', - [(wordsize(64), 20619433656, 5) + [(wordsize(64), 21554874976, 5) # 2012-08-14: 3255435248 (amd64/Linux) # 2012-08-29: 3324606664 (amd64/Linux, new codegen) # 2012-10-08: 3373401360 (amd64/Linux) @@ -89,6 +89,7 @@ test('haddock.Cabal', # of new modules; if you exclude them from the haddock run # the stats are comparable. # 2016-10-01: 20619433656 (amd64/Linux) - Cabal update + # 2016-10-03: 21554874976 (amd64/Linux) - Cabal update ,(platform('i386-unknown-mingw32'), 3293415576, 5) # 2012-10-30: 1733638168 (x86/Windows) diff --git a/testsuite/tests/plugins/T11244.stderr b/testsuite/tests/plugins/T11244.stderr index 30c8c5b127..f489103f28 100644 --- a/testsuite/tests/plugins/T11244.stderr +++ b/testsuite/tests/plugins/T11244.stderr @@ -1,3 +1,4 @@ <command line>: Could not find module ‘RuleDefiningPlugin’ -It is a member of the hidden package ‘rule-defining-plugin-0.1’. +Perhaps you meant + RuleDefiningPlugin (from rule-defining-plugin-0.1) Use -v to see a list of the files searched for. diff --git a/testsuite/tests/safeHaskell/check/Check07.stderr b/testsuite/tests/safeHaskell/check/Check07.stderr index dafdad6cba..f41fbe0bde 100644 --- a/testsuite/tests/safeHaskell/check/Check07.stderr +++ b/testsuite/tests/safeHaskell/check/Check07.stderr @@ -1,3 +1,3 @@ -[1 of 3] Compiling Check07_B ( Check07_B.hs, Check07_B.o ) -[2 of 3] Compiling Check07_A ( Check07_A.hs, Check07_A.o ) +[1 of 3] Compiling Check07_A ( Check07_A.hs, Check07_A.o ) +[2 of 3] Compiling Check07_B ( Check07_B.hs, Check07_B.o ) [3 of 3] Compiling Check07 ( Check07.hs, Check07.o ) diff --git a/testsuite/tests/safeHaskell/check/Check08.stderr b/testsuite/tests/safeHaskell/check/Check08.stderr index a1f6c64a74..e081a984e8 100644 --- a/testsuite/tests/safeHaskell/check/Check08.stderr +++ b/testsuite/tests/safeHaskell/check/Check08.stderr @@ -1,6 +1,6 @@ -[1 of 3] Compiling Check08_B ( Check08_B.hs, Check08_B.o ) -[2 of 3] Compiling Check08_A ( Check08_A.hs, Check08_A.o ) +[1 of 3] Compiling Check08_A ( Check08_A.hs, Check08_A.o ) +[2 of 3] Compiling Check08_B ( Check08_B.hs, Check08_B.o ) [3 of 3] Compiling Check08 ( Check08.hs, Check08.o ) -<no location info>: +<no location info>: error: The package (base-4.9.0.0) is required to be trusted but it isn't! diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr b/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr index 066b56c4bb..b23875bf1d 100644 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr +++ b/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr @@ -4,7 +4,8 @@ SafeLang12.hs:2:14: warning: SafeLang12_B.hs:2:14: warning: -XTemplateHaskell is not allowed in Safe Haskell; ignoring -XTemplateHaskell -[1 of 3] Compiling SafeLang12_B ( SafeLang12_B.hs, SafeLang12_B.o ) +[1 of 3] Compiling SafeLang12_A ( SafeLang12_A.hs, SafeLang12_A.o ) +[2 of 3] Compiling SafeLang12_B ( SafeLang12_B.hs, SafeLang12_B.o ) SafeLang12_B.hs:5:1: error: Language.Haskell.TH: Can't be safely imported! diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 3ffdcf745f..c40255e92b 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -357,7 +357,6 @@ test('tc262', normal, compile, ['']) test('tc263', extra_clean(['Tc263_Help.o','Tc263_Help.hi']), multimod_compile, ['tc263','-v0']) -test('tc264', normal, multimod_compile, ['tc264.hsig', '-sig-of "ShouldCompile is base:Data.STRef"']) test('tc265', compile_timeout_multiplier(0.01), compile, ['']) test('tc266', [extra_clean(['Tc266.hi-boot', 'Tc266.o-boot', 'Tc266a.hi', 'Tc266a.o', 'Tc266.hi', 'Tc266.o']), run_timeout_multiplier(0.01)] , diff --git a/testsuite/tests/typecheck/should_compile/tc264.hsig b/testsuite/tests/typecheck/should_compile/tc264.hsig deleted file mode 100644 index 0bfdb2b9f4..0000000000 --- a/testsuite/tests/typecheck/should_compile/tc264.hsig +++ /dev/null @@ -1,2 +0,0 @@ -module ShouldCompile(newSTRef) where -import Data.STRef(newSTRef) diff --git a/testsuite/tests/typecheck/should_fail/T6018fail.stderr b/testsuite/tests/typecheck/should_fail/T6018fail.stderr index 11c665ac4f..e40cb84d12 100644 --- a/testsuite/tests/typecheck/should_fail/T6018fail.stderr +++ b/testsuite/tests/typecheck/should_fail/T6018fail.stderr @@ -1,7 +1,7 @@ -[1 of 5] Compiling T6018Bfail ( T6018Bfail.hs, T6018Bfail.o ) -[2 of 5] Compiling T6018Cfail ( T6018Cfail.hs, T6018Cfail.o ) -[3 of 5] Compiling T6018Dfail ( T6018Dfail.hs, T6018Dfail.o ) -[4 of 5] Compiling T6018Afail ( T6018Afail.hs, T6018Afail.o ) +[1 of 5] Compiling T6018Afail ( T6018Afail.hs, T6018Afail.o ) +[2 of 5] Compiling T6018Bfail ( T6018Bfail.hs, T6018Bfail.o ) +[3 of 5] Compiling T6018Cfail ( T6018Cfail.hs, T6018Cfail.o ) +[4 of 5] Compiling T6018Dfail ( T6018Dfail.hs, T6018Dfail.o ) [5 of 5] Compiling T6018fail ( T6018fail.hs, T6018fail.o ) T6018Afail.hs:7:15: error: diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index e595000936..d040b5853e 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -242,10 +242,6 @@ test('tcfail215', normal, compile_fail, ['']) test('tcfail216', normal, compile_fail, ['']) test('tcfail217', normal, compile_fail, ['']) test('tcfail218', normal, compile_fail, ['']) -test('tcfail219', normal, multimod_compile_fail, ['tcfail219.hsig', '-sig-of "ShouldFail is base:Data.Bool"']) -test('tcfail220', normal, multimod_compile_fail, ['tcfail220.hsig', '-sig-of "ShouldFail is base:Prelude"']) -test('tcfail221', normal, multimod_compile_fail, ['tcfail221.hsig', '-sig-of "ShouldFail is base:Prelude"']) -test('tcfail222', normal, multimod_compile_fail, ['tcfail222.hsig', '-sig-of "ShouldFail is base:Data.STRef"']) test('tcfail223', normal, compile_fail, ['']) test('tcfail224', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail219.hsig b/testsuite/tests/typecheck/should_fail/tcfail219.hsig deleted file mode 100644 index ec6d6076ab..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail219.hsig +++ /dev/null @@ -1,2 +0,0 @@ -module ShouldFail where -data Booly diff --git a/testsuite/tests/typecheck/should_fail/tcfail219.stderr b/testsuite/tests/typecheck/should_fail/tcfail219.stderr deleted file mode 100644 index 53a7edebe0..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail219.stderr +++ /dev/null @@ -1,3 +0,0 @@ -[1 of 1] Compiling ShouldFail[sig of Data.Bool] ( tcfail219.hsig, nothing ) - -tcfail219.hsig:1:1: Not in scope: type constructor or class ‘Booly’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail220.hsig b/testsuite/tests/typecheck/should_fail/tcfail220.hsig deleted file mode 100644 index c9e80e3da2..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail220.hsig +++ /dev/null @@ -1,4 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -module ShouldFail where - -data Either a b c = Left a diff --git a/testsuite/tests/typecheck/should_fail/tcfail220.stderr b/testsuite/tests/typecheck/should_fail/tcfail220.stderr deleted file mode 100644 index 6228bfa984..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail220.stderr +++ /dev/null @@ -1,9 +0,0 @@ -[1 of 1] Compiling ShouldFail[sig of Prelude] ( tcfail220.hsig, nothing ) - -tcfail220.hsig:4:1: error: - Type constructor ‘Either’ has conflicting definitions in the module - and its hsig file - Main module: data Either a b = Left a | Data.Either.Right b - Hsig file: type role Either representational phantom phantom - data Either a b c = Left a - The types have different kinds diff --git a/testsuite/tests/typecheck/should_fail/tcfail221.hsig b/testsuite/tests/typecheck/should_fail/tcfail221.hsig deleted file mode 100644 index a60c1a0d80..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail221.hsig +++ /dev/null @@ -1,3 +0,0 @@ -module ShouldFail where -instance Show Int -instance Show Int diff --git a/testsuite/tests/typecheck/should_fail/tcfail221.stderr b/testsuite/tests/typecheck/should_fail/tcfail221.stderr deleted file mode 100644 index 8781bd056e..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail221.stderr +++ /dev/null @@ -1,6 +0,0 @@ -[1 of 1] Compiling ShouldFail[sig of Prelude] ( tcfail221.hsig, nothing ) - -tcfail221.hsig:2:10: - Duplicate instance declarations: - instance Show Int -- Defined at tcfail221.hsig:2:10 - instance Show Int -- Defined at tcfail221.hsig:3:10 diff --git a/testsuite/tests/typecheck/should_fail/tcfail222.hsig b/testsuite/tests/typecheck/should_fail/tcfail222.hsig deleted file mode 100644 index e83f4e3b83..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail222.hsig +++ /dev/null @@ -1,2 +0,0 @@ -module ShouldFail(newSTRef) where -import Data.STRef.Lazy(newSTRef) diff --git a/testsuite/tests/typecheck/should_fail/tcfail222.stderr b/testsuite/tests/typecheck/should_fail/tcfail222.stderr deleted file mode 100644 index c600ee38ab..0000000000 --- a/testsuite/tests/typecheck/should_fail/tcfail222.stderr +++ /dev/null @@ -1,4 +0,0 @@ -[1 of 1] Compiling ShouldFail[sig of Data.STRef] ( tcfail222.hsig, nothing ) - -<no location info>: error: - ‘newSTRef’ is exported by the hsig file, but not exported by the module |