diff options
Diffstat (limited to 'testsuite')
140 files changed, 987 insertions, 254 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore index a1481ad1ce..a2b645429b 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -128,6 +128,7 @@ mk/ghcconfig*_bin_ghc*.exe.mk /tests/cabal/localT1750.package.conf/ /tests/cabal/localshadow1.package.conf/ /tests/cabal/localshadow2.package.conf/ +/tests/cabal/localshadow3.package.conf/ /tests/cabal/package.conf.*/ /tests/cabal/recache_reexport_db/package.cache /tests/cabal/shadow.hs diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 5a0770d02f..efadb0310b 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -210,6 +210,9 @@ from testlib import * if windows or darwin: pkginfo = getStdout([config.ghc_pkg, 'dump']) topdir = config.libdir + if windows: + mingw = os.path.join(topdir, '../mingw/bin') + os.environ['PATH'] = os.pathsep.join([os.environ.get("PATH", ""), mingw]) for line in pkginfo.split('\n'): if line.startswith('library-dirs:'): path = line.rstrip() diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 5ca17f2484..3ca5d026f5 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1646,14 +1646,14 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file, if config.verbose >= 1 and _expect_pass(way): # See Note [Output comparison]. - r = os.system('diff -uw {} {}'.format(expected_normalised_path, - actual_normalised_path)) + r = os.system('diff -uw {0} {1}'.format(expected_normalised_path, + actual_normalised_path)) # If for some reason there were no non-whitespace differences, # then do a full diff if r == 0: - r = os.system('diff -u {} {}'.format(expected_normalised_path, - actual_normalised_path)) + r = os.system('diff -u {0} {1}'.format(expected_normalised_path, + actual_normalised_path)) if config.accept and (getTestOpts().expect == 'fail' or way in getTestOpts().expect_fail_for): @@ -1691,7 +1691,7 @@ def normalise_callstacks(str): def repl(matches): location = matches.group(1) location = normalise_slashes_(location) - return ', called at {}:<line>:<column> in <package-id>:'.format(location) + return ', called at {0}:<line>:<column> in <package-id>:'.format(location) # Ignore line number differences in call stacks (#10834). return re.sub(', called at (.+):[\\d]+:[\\d]+ in [\\w\-\.]+:', repl, str) @@ -1818,7 +1818,7 @@ def rawSystemWithTimeout(cmd_and_args): if r == 99 and getTestOpts().exit_code != 99: # Only print a message when timeout killed the process unexpectedly. cmd = cmd_and_args[-1] - if_verbose(1, 'Timeout happened...killed process "{}"...\n'.format(cmd)) + if_verbose(1, 'Timeout happened...killed process "{0}"...\n'.format(cmd)) return r # cmd is a complex command in Bourne-shell syntax diff --git a/testsuite/mk/ghc-config.hs b/testsuite/mk/ghc-config.hs index 9a6a5e74df..c5ad5ff3b7 100644 --- a/testsuite/mk/ghc-config.hs +++ b/testsuite/mk/ghc-config.hs @@ -34,6 +34,12 @@ main = do _ -> "package-conf" putStrLn $ "GhcPackageDbFlag" ++ '=':pkgdb_flag + let minGhcVersion711 = case lookup "Project version" fields of + Just v + | parseVersion v >= [7,11] -> "YES" + _ -> "NO" + putStrLn $ "MinGhcVersion711" ++ '=':minGhcVersion711 + getGhcFieldOrFail :: [(String,String)] -> String -> String -> IO () getGhcFieldOrFail fields mkvar key diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 27d7f733af..e20a522219 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -44,9 +44,11 @@ TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user- # TEST_HC_OPTS += -fno-warn-tabs +ifeq "$(MinGhcVersion711)" "YES" # Don't warn about missing specialisations. They can only occur with `-O`, but # we want tests to produce the same output for all test ways. TEST_HC_OPTS += -fno-warn-missed-specialisations +endif RUNTEST_OPTS = diff --git a/testsuite/tests/annotations/should_fail/annfail10.stderr b/testsuite/tests/annotations/should_fail/annfail10.stderr index a8236709c2..1e77541499 100644 --- a/testsuite/tests/annotations/should_fail/annfail10.stderr +++ b/testsuite/tests/annotations/should_fail/annfail10.stderr @@ -1,8 +1,9 @@ annfail10.hs:9:1: error: - No instance for (Data a0) arising from an annotation - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from an annotation + prevents the constraint ‘(Data a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance (Data a, Data b) => Data (Either a b) -- Defined in ‘Data.Data’ instance Data All -- Defined in ‘Data.Data’ @@ -13,9 +14,10 @@ annfail10.hs:9:1: error: In the annotation: {-# ANN f 1 #-} annfail10.hs:9:11: error: - No instance for (Num a0) arising from the literal ‘1’ - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance forall (k :: BOX) (f :: k -> *) (a :: k). Num (f a) => Num (Alt f a) diff --git a/testsuite/tests/cabal/Makefile b/testsuite/tests/cabal/Makefile index 47cd95d010..7644bd8467 100644 --- a/testsuite/tests/cabal/Makefile +++ b/testsuite/tests/cabal/Makefile @@ -127,43 +127,51 @@ T1750: PKGCONFSHADOW1=localshadow1.package.conf PKGCONFSHADOW2=localshadow2.package.conf +PKGCONFSHADOW3=localshadow3.package.conf LOCAL_GHC_PKGSHADOW1 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW1) LOCAL_GHC_PKGSHADOW2 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW2) -LOCAL_GHC_PKGSHADOW3 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW1) -f $(PKGCONFSHADOW2) +LOCAL_GHC_PKGSHADOW3 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW3) +LOCAL_GHC_PKGSHADOW12 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW1) -f $(PKGCONFSHADOW2) +LOCAL_GHC_PKGSHADOW13 = '$(GHC_PKG)' --no-user-package-db -f $(PKGCONFSHADOW1) -f $(PKGCONFSHADOW3) # Test package shadowing behaviour. # # localshadow1.package.conf: shadowdep-1-XXX <- shadow-1-XXX -# localshadow2.package.conf: shadow-1-YYY -# -# shadow-1-XXX will be shadowed by shadow-1-YYY, thus invalidating -# shadowdep-1-XXX. +# localshadow2.package.conf: shadow-1-XXX +# +# If the ABI hash of boths shadow-1s are the same, we'll just accept +# the later shadow version. However, if the ABIs are different, we +# should complain! shadow: - rm -rf $(PKGCONFSHADOW1) $(PKGCONFSHADOW2) shadow.hs shadow.o shadow.hi shadow.out shadow.hs shadow.hi + rm -rf $(PKGCONFSHADOW1) $(PKGCONFSHADOW2) $(PKGCONFSHADOW3) shadow.hs shadow.o shadow.hi shadow.out shadow.hs shadow.hi $(LOCAL_GHC_PKGSHADOW1) init $(PKGCONFSHADOW1) $(LOCAL_GHC_PKGSHADOW2) init $(PKGCONFSHADOW2) + $(LOCAL_GHC_PKGSHADOW3) init $(PKGCONFSHADOW3) $(LOCAL_GHC_PKGSHADOW1) register -v0 --force shadow1.pkg $(LOCAL_GHC_PKGSHADOW1) register -v0 --force shadow2.pkg $(LOCAL_GHC_PKGSHADOW2) register -v0 --force shadow3.pkg - $(LOCAL_GHC_PKGSHADOW3) list + $(LOCAL_GHC_PKGSHADOW3) register -v0 --force shadow1.pkg + @echo "databases 1 and 2:" + $(LOCAL_GHC_PKGSHADOW12) list + @echo "databases 1 and 3:" + $(LOCAL_GHC_PKGSHADOW13) list echo "main = return ()" >shadow.hs # -# In this test, shadow-1-XXX is shadowed by shadow-1-YYY, which causes -# shadowdep-1-XXX to be unavailable: +# In this test, shadow-1-XXX with ABI hash aaa conflicts with shadow-1-XXX with +# ABI hash bbb, so GHC errors # @echo "should FAIL:" - '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW1) -package-db $(PKGCONFSHADOW2) -package shadowdep -c shadow.hs -fno-code || true -# -# Reversing the order of the package.conf files should fix the problem: + if '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW1) -package-db $(PKGCONFSHADOW2) -package shadowdep -c shadow.hs -fno-code; then false; else true; fi # - @echo "should SUCCEED:" - '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW2) -package-db $(PKGCONFSHADOW1) -package shadowdep -c shadow.hs -fno-code || true +# Reversing the orders of the configs does not fix the problem +# + @echo "should FAIL:" + if '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW2) -package-db $(PKGCONFSHADOW1) -package shadowdep -c shadow.hs -fno-code; then false; else true; fi # -# We can also fix the problem by using an explicit -package-id flag to -# specify a package we really want to use: +# When the ABIs are the same, there is no problem # @echo "should SUCCEED:" - '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW1) -package-db $(PKGCONFSHADOW2) -package-id shadowdep-1-XXX -c shadow.hs -fno-code + '$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(PKGCONFSHADOW3) -package-db $(PKGCONFSHADOW1) -package shadowdep -c shadow.hs -fno-code # If we pass --global, we should ignore instances in the user database T5442a: @@ -210,7 +218,7 @@ T5442d: '$(GHC_PKG)' init package.conf.T5442d.user '$(GHC_PKG)' init package.conf.T5442d.extra '$(GHC_PKG)' -f package.conf.T5442d.global register --force-files shadow1.pkg 2>/dev/null - '$(GHC_PKG)' -f package.conf.T5442d.user register --force-files shadow3.pkg 2>/dev/null + '$(GHC_PKG)' -f package.conf.T5442d.user register --force-files shadow4.pkg 2>/dev/null '$(GHC_PKG)' --global-package-db=package.conf.T5442d.global -f package.conf.T5442d.extra register --force-files shadow2.pkg 2>/dev/null '$(GHC_PKG)' --global-package-db=package.conf.T5442d.global --user-package-db=package.conf.T5442d.user -f package.conf.T5442d.extra --global unregister shadow --force @echo "global (should be empty):" diff --git a/testsuite/tests/cabal/T1750A.pkg b/testsuite/tests/cabal/T1750A.pkg index 3f4a96e22b..9bda51eea0 100644 --- a/testsuite/tests/cabal/T1750A.pkg +++ b/testsuite/tests/cabal/T1750A.pkg @@ -1,5 +1,4 @@ name: T1750A version: 1 id: T1750A-1-XXX -key: T1750A-1 depends: T1750B-1-XXX diff --git a/testsuite/tests/cabal/T1750B.pkg b/testsuite/tests/cabal/T1750B.pkg index caaaefaa1a..479ce7092c 100644 --- a/testsuite/tests/cabal/T1750B.pkg +++ b/testsuite/tests/cabal/T1750B.pkg @@ -1,5 +1,4 @@ name: T1750B version: 1 id: T1750B-1-XXX -key: T1750B-1 depends: T1750A-1-XXX diff --git a/testsuite/tests/cabal/T5442d.stdout b/testsuite/tests/cabal/T5442d.stdout index 05c6619dde..f3214578d2 100644 --- a/testsuite/tests/cabal/T5442d.stdout +++ b/testsuite/tests/cabal/T5442d.stdout @@ -1,8 +1,8 @@ Reading package info from "shadow1.pkg" ... done. -Reading package info from "shadow3.pkg" ... done. +Reading package info from "shadow4.pkg" ... done. Reading package info from "shadow2.pkg" ... done. global (should be empty): user: -shadow-1 +shadow-2 extra: shadowdep-1 diff --git a/testsuite/tests/cabal/cabal03/Makefile b/testsuite/tests/cabal/cabal03/Makefile index b5520e3d08..97659344d9 100644 --- a/testsuite/tests/cabal/cabal03/Makefile +++ b/testsuite/tests/cabal/cabal03/Makefile @@ -20,14 +20,14 @@ cabal03: clean '$(GHC_PKG)' init tmp.d '$(TEST_HC)' -v0 --make Setup cd p && $(SETUP) clean - cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force + cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force --ipid p-noopt cd p && $(SETUP) build cd p && $(SETUP) register cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force cd q && $(SETUP) build cd q && $(SETUP) register cd p && $(SETUP) clean - cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force + cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force --ipid p-withopt cd p && $(SETUP) build cd p && $(SETUP) register cd r && ! ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force diff --git a/testsuite/tests/cabal/cabal06/Makefile b/testsuite/tests/cabal/cabal06/Makefile index 8b918a0e2c..9f47ea5756 100644 --- a/testsuite/tests/cabal/cabal06/Makefile +++ b/testsuite/tests/cabal/cabal06/Makefile @@ -4,7 +4,7 @@ include $(TOP)/mk/test.mk SETUP=../Setup -v0 -# This test is for packages whose package IDs overlap, but whose package keys +# This test is for packages whose package IDs overlap, but whose IPIDs # do not. # # 1. install p-1.0 @@ -15,7 +15,7 @@ SETUP=../Setup -v0 # 6. install r-1.0 asking for p-1.0 # # The notable steps are (4), which previously would have required a reinstall, -# and (6), where the dependency solver picks between two package keys with the +# and (6), where the dependency solver picks between two IPIDs with the # same package ID based on their depenencies. # # ./Setup configure is pretty dumb, so we spoonfeed it precisely the @@ -29,7 +29,7 @@ cabal06: clean cd p-1.0 && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --prefix='$(PWD)/inst-a' --ghc-pkg-options='--enable-multi-instance' cd p-1.0 && $(SETUP) build cd p-1.0 && $(SETUP) copy - cd p-1.0 && $(SETUP) register + (cd p-1.0 && $(SETUP) register --print-ipid) > tmp_p_1_0 cd q && $(SETUP) clean cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --prefix='$(PWD)/inst-b' --ghc-pkg-options='--enable-multi-instance' cd q && $(SETUP) build @@ -39,16 +39,16 @@ cabal06: clean cd p-1.1 && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --prefix='$(PWD)/inst-c' --ghc-pkg-options='--enable-multi-instance' cd p-1.1 && $(SETUP) build cd p-1.1 && $(SETUP) copy - cd p-1.1 && $(SETUP) register + (cd p-1.1 && $(SETUP) register --print-ipid) > tmp_p_1_1 cd q && $(SETUP) clean cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --constraint="p==1.1" --prefix='$(PWD)/inst-d' --ghc-pkg-options='--enable-multi-instance' cd q && $(SETUP) build cd q && $(SETUP) copy (cd q && $(SETUP) register --print-ipid) > tmp_second_q @echo "Does the first instance of q depend on p-1.0?" - '$(GHC_PKG)' field --ipid `cat tmp_first_q` depends -f tmp.d | grep p-1.0 | wc -l | sed 's/[[:space:]]//g' + '$(GHC_PKG)' field --ipid `cat tmp_first_q` depends -f tmp.d | grep `cat tmp_p_1_0` | wc -l | sed 's/[[:space:]]//g' @echo "Does the second instance of q depend on p-1.0?" - '$(GHC_PKG)' field --ipid `cat tmp_second_q` depends -f tmp.d | grep p-1.1 | wc -l | sed 's/[[:space:]]//g' + '$(GHC_PKG)' field --ipid `cat tmp_second_q` depends -f tmp.d | grep `cat tmp_p_1_1` | wc -l | sed 's/[[:space:]]//g' cd r && $(SETUP) clean cd r && ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --dependency="q=`cat ../tmp_first_q`" --constraint="p==1.0" --prefix='$(PWD)/inst-e' --ghc-pkg-options='--enable-multi-instance' cd r && $(SETUP) build diff --git a/testsuite/tests/cabal/cabal07/all.T b/testsuite/tests/cabal/cabal07/all.T index 2286f30783..2052c891f2 100644 --- a/testsuite/tests/cabal/cabal07/all.T +++ b/testsuite/tests/cabal/cabal07/all.T @@ -3,10 +3,7 @@ if default_testopts.cleanup != '': else: cleanup = '' -def normaliseContainersPackage(str): - return re.sub('containers-[^@]+@[A-Za-z0-9]+', 'containers-<VERSION>@<HASH>', str) - test('cabal07', - normalise_errmsg_fun(normaliseContainersPackage), + normalise_version('containers'), run_command, ['$MAKE -s --no-print-directory cabal07 ' + cleanup]) diff --git a/testsuite/tests/cabal/cabal07/cabal07.stderr b/testsuite/tests/cabal/cabal07/cabal07.stderr index 23249b68ff..b1b90c1528 100644 --- a/testsuite/tests/cabal/cabal07/cabal07.stderr +++ b/testsuite/tests/cabal/cabal07/cabal07.stderr @@ -1,6 +1,6 @@ Q.hs:3:8: error: Could not find module ‘Data.Set’ - It is a member of the hidden package ‘containers-0.5.6.2@0tT640fErehCGZtZRn6YbE’. + It is a member of the hidden package ‘containers-0.5.6.2@containers-0.5.6.2’. Perhaps you need to add ‘containers’ to the build-depends in your .cabal file. Use -v to see a list of the files searched for. diff --git a/testsuite/tests/cabal/ghcpkg01.stdout b/testsuite/tests/cabal/ghcpkg01.stdout index c8faf7fdbb..c056cf9824 100644 --- a/testsuite/tests/cabal/ghcpkg01.stdout +++ b/testsuite/tests/cabal/ghcpkg01.stdout @@ -4,7 +4,7 @@ Reading package info from "test.pkg" ... done. name: testpkg version: 1.2.3.4 id: testpkg-1.2.3.4-XXX -key: testpkg-1.2.3.4 +key: testpkg-1.2.3.4-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -19,17 +19,18 @@ exposed: True exposed-modules: A hidden-modules: B C.D +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-1.2.3.4 +hs-libraries: testpkg-1.2.3.4-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: name: testpkg version: 1.2.3.4 id: testpkg-1.2.3.4-XXX -key: testpkg-1.2.3.4 +key: testpkg-1.2.3.4-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -44,10 +45,11 @@ exposed: True exposed-modules: A hidden-modules: B C.D +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-1.2.3.4 +hs-libraries: testpkg-1.2.3.4-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: @@ -60,7 +62,7 @@ local01.package.conf: name: testpkg version: 2.0 id: testpkg-2.0-XXX -key: testpkg-2.0 +key: testpkg-2.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -75,17 +77,18 @@ exposed: False exposed-modules: A hidden-modules: B C.D C.E +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-2.0 +hs-libraries: testpkg-2.0-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: name: testpkg version: 2.0 id: testpkg-2.0-XXX -key: testpkg-2.0 +key: testpkg-2.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -100,17 +103,18 @@ exposed: False exposed-modules: A hidden-modules: B C.D C.E +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-2.0 +hs-libraries: testpkg-2.0-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: --- name: testpkg version: 1.2.3.4 id: testpkg-1.2.3.4-XXX -key: testpkg-1.2.3.4 +key: testpkg-1.2.3.4-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -125,10 +129,11 @@ exposed: True exposed-modules: A hidden-modules: B C.D +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-1.2.3.4 +hs-libraries: testpkg-1.2.3.4-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: @@ -142,7 +147,7 @@ Reading package info from "test3.pkg" ... done. name: testpkg version: 1.2.3.4 id: testpkg-1.2.3.4-XXX -key: testpkg-1.2.3.4 +key: testpkg-1.2.3.4-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -157,10 +162,11 @@ exposed: False exposed-modules: A hidden-modules: B C.D +abi: trusted: False import-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg "c:/Program Files/testpkg" -hs-libraries: testpkg-1.2.3.4 +hs-libraries: testpkg-1.2.3.4-XXX include-dirs: /usr/local/include/testpkg "c:/Program Files/testpkg" pkgroot: diff --git a/testsuite/tests/cabal/ghcpkg03.stderr b/testsuite/tests/cabal/ghcpkg03.stderr index 05d288dce2..31eb7ecee5 100644 --- a/testsuite/tests/cabal/ghcpkg03.stderr +++ b/testsuite/tests/cabal/ghcpkg03.stderr @@ -7,7 +7,7 @@ testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring) testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring) testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring) -testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4.a","libtestpkg-1.2.3.4.p_a","libtestpkg-1.2.3.4-ghc<VERSION>.so","libtestpkg-1.2.3.4-ghc<VERSION>.dylib","testpkg-1.2.3.4-ghc<VERSION>.dll"] on library path (ignoring) +testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring) testpkg-2.0: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory testpkg-2.0: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory testpkg-2.0: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring) @@ -18,7 +18,7 @@ testpkg-2.0: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring) testpkg-2.0: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring) testpkg-2.0: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring) testpkg-2.0: cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"] (ignoring) -testpkg-2.0: cannot find any of ["libtestpkg-2.0.a","libtestpkg-2.0.p_a","libtestpkg-2.0-ghc<VERSION>.so","libtestpkg-2.0-ghc<VERSION>.dylib","testpkg-2.0-ghc<VERSION>.dll"] on library path (ignoring) +testpkg-2.0: cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path (ignoring) testpkg-1.2.3.4: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory testpkg-1.2.3.4: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring) @@ -28,4 +28,4 @@ testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring) testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring) testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring) -testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4.a","libtestpkg-1.2.3.4.p_a","libtestpkg-1.2.3.4-ghc<VERSION>.so","libtestpkg-1.2.3.4-ghc<VERSION>.dylib","testpkg-1.2.3.4-ghc<VERSION>.dll"] on library path (ignoring) +testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring) diff --git a/testsuite/tests/cabal/ghcpkg05.stderr b/testsuite/tests/cabal/ghcpkg05.stderr index df8d11a6b9..7440a6fb6c 100644 --- a/testsuite/tests/cabal/ghcpkg05.stderr +++ b/testsuite/tests/cabal/ghcpkg05.stderr @@ -9,7 +9,30 @@ There are problems in package testpkg-2.0: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"] - cannot find any of ["libtestpkg-2.0.a","libtestpkg-2.0.p_a","libtestpkg-2.0-ghc<VERSION>.so","libtestpkg-2.0-ghc<VERSION>.dylib","testpkg-2.0-ghc<VERSION>.dll"] on library path + cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/compiler/stage2/doc/html/ghc/ghc.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/haskeline/dist-install/doc/html/haskeline/haskeline.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/terminfo/dist-install/doc/html/terminfo/terminfo.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/transformers/dist-install/doc/html/transformers/transformers.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/hoopl/dist-install/doc/html/hoopl/hoopl.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/bin-package-db/dist-install/doc/html/bin-package-db/bin-package-db.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/Cabal/Cabal/dist-install/doc/html/Cabal/Cabal.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/binary/dist-install/doc/html/binary/binary.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/template-haskell/dist-install/doc/html/template-haskell/template-haskell.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/pretty/dist-install/doc/html/pretty/pretty.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/hpc/dist-install/doc/html/hpc/hpc.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/process/dist-install/doc/html/process/process.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/directory/dist-install/doc/html/directory/directory.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/unix/dist-install/doc/html/unix/unix.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/time/dist-install/doc/html/time/time.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/containers/dist-install/doc/html/containers/containers.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/bytestring/dist-install/doc/html/bytestring/bytestring.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/deepseq/dist-install/doc/html/deepseq/deepseq.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/array/dist-install/doc/html/array/array.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/filepath/dist-install/doc/html/filepath/filepath.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/base/dist-install/doc/html/base/base.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/integer-gmp/dist-install/doc/html/integer-gmp/integer-gmp.haddock doesn't exist or isn't a file +Warning: haddock-interfaces: /home/hs01/ezyang/ghc-quick2/libraries/ghc-prim/dist-install/doc/html/ghc-prim/ghc-prim.haddock doesn't exist or isn't a file The following packages are broken, either because they have a problem listed above, or because they depend on a broken package. diff --git a/testsuite/tests/cabal/shadow.stderr b/testsuite/tests/cabal/shadow.stderr index a0a38cde22..3825896e85 100644 --- a/testsuite/tests/cabal/shadow.stderr +++ b/testsuite/tests/cabal/shadow.stderr @@ -1,4 +1,4 @@ -<command line>: cannot satisfy -package shadowdep: - shadowdep-1-XXX is unusable due to missing or recursive dependencies: - shadow-1-XXX - (use -v for more information) +<command line>: package db: duplicate packages with incompatible ABIs: + shadow-1-XXX has ABIs: aaa, bbb +<command line>: package db: duplicate packages with incompatible ABIs: + shadow-1-XXX has ABIs: aaa, bbb diff --git a/testsuite/tests/cabal/shadow.stdout b/testsuite/tests/cabal/shadow.stdout index 0d14e9cb8a..f4b783aa7d 100644 --- a/testsuite/tests/cabal/shadow.stdout +++ b/testsuite/tests/cabal/shadow.stdout @@ -1,3 +1,4 @@ +databases 1 and 2: localshadow1.package.conf: (shadow-1) (shadowdep-1) @@ -5,6 +6,14 @@ localshadow1.package.conf: localshadow2.package.conf: (shadow-1) +databases 1 and 3: +localshadow1.package.conf: + (shadow-1) + (shadowdep-1) + +localshadow3.package.conf: + (shadow-1) + +should FAIL: should FAIL: -should SUCCEED: should SUCCEED: diff --git a/testsuite/tests/cabal/shadow1.pkg b/testsuite/tests/cabal/shadow1.pkg index 553ebeb776..1e3960202c 100644 --- a/testsuite/tests/cabal/shadow1.pkg +++ b/testsuite/tests/cabal/shadow1.pkg @@ -1,5 +1,6 @@ name: shadow version: 1 id: shadow-1-XXX -key: shadow-1 +key: shadow-1-XXX +abi: aaa depends: diff --git a/testsuite/tests/cabal/shadow2.pkg b/testsuite/tests/cabal/shadow2.pkg index ae89641176..5cd54cca02 100644 --- a/testsuite/tests/cabal/shadow2.pkg +++ b/testsuite/tests/cabal/shadow2.pkg @@ -1,5 +1,5 @@ name: shadowdep version: 1 id: shadowdep-1-XXX -key: shadowdep-1 +key: shadowdep-1-XXX depends: shadow-1-XXX diff --git a/testsuite/tests/cabal/shadow3.pkg b/testsuite/tests/cabal/shadow3.pkg index 62c93f95e1..6640e9da10 100644 --- a/testsuite/tests/cabal/shadow3.pkg +++ b/testsuite/tests/cabal/shadow3.pkg @@ -1,5 +1,6 @@ name: shadow version: 1 -id: shadow-1-YYY -key: shadow-1 +id: shadow-1-XXX +key: shadow-1-XXX +abi: bbb depends: diff --git a/testsuite/tests/cabal/shadow4.pkg b/testsuite/tests/cabal/shadow4.pkg new file mode 100644 index 0000000000..fb4e08e4a4 --- /dev/null +++ b/testsuite/tests/cabal/shadow4.pkg @@ -0,0 +1,6 @@ +name: shadow +version: 2 +id: shadow-2-ZZZ +key: shadow-2-ZZZ +abi: zzz +depends: diff --git a/testsuite/tests/cabal/test.pkg b/testsuite/tests/cabal/test.pkg index 42c557a0f9..4a1adc93eb 100644 --- a/testsuite/tests/cabal/test.pkg +++ b/testsuite/tests/cabal/test.pkg @@ -1,7 +1,7 @@ name: testpkg version: 1.2.3.4 id: testpkg-1.2.3.4-XXX -key: testpkg-1.2.3.4 +key: testpkg-1.2.3.4-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -17,4 +17,4 @@ hidden-modules: B, "C.D" import-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" include-dirs: /usr/local/include/testpkg, "c:/Program Files/testpkg" -hs-libraries: testpkg-1.2.3.4 +hs-libraries: testpkg-1.2.3.4-XXX diff --git a/testsuite/tests/cabal/test2.pkg b/testsuite/tests/cabal/test2.pkg index c027ed3a15..0c627d2e13 100644 --- a/testsuite/tests/cabal/test2.pkg +++ b/testsuite/tests/cabal/test2.pkg @@ -1,7 +1,7 @@ name: "testpkg" version: 2.0 id: testpkg-2.0-XXX -key: testpkg-2.0 +key: testpkg-2.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -17,4 +17,4 @@ hidden-modules: B, "C.D", "C.E" import-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" include-dirs: /usr/local/include/testpkg, "c:/Program Files/testpkg" -hs-libraries: testpkg-2.0 +hs-libraries: testpkg-2.0-XXX diff --git a/testsuite/tests/cabal/test3.pkg b/testsuite/tests/cabal/test3.pkg index 8f1ca04366..2c017422c0 100644 --- a/testsuite/tests/cabal/test3.pkg +++ b/testsuite/tests/cabal/test3.pkg @@ -1,7 +1,7 @@ name: "testpkg" version: 3.0 id: testpkg-3.0-XXX -key: testpkg-3.0 +key: testpkg-3.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org diff --git a/testsuite/tests/cabal/test4.pkg b/testsuite/tests/cabal/test4.pkg index c4b1883512..eba9509572 100644 --- a/testsuite/tests/cabal/test4.pkg +++ b/testsuite/tests/cabal/test4.pkg @@ -1,7 +1,7 @@ name: "testpkg" version: 4.0 id: testpkg-4.0-XXX -key: testpkg-4.0 +key: testpkg-4.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org diff --git a/testsuite/tests/cabal/test5.pkg b/testsuite/tests/cabal/test5.pkg index 48e198cd30..c66d19bc0c 100644 --- a/testsuite/tests/cabal/test5.pkg +++ b/testsuite/tests/cabal/test5.pkg @@ -1,7 +1,7 @@ name: "newtestpkg" version: 2.0 id: newtestpkg-2.0-XXX -key: newtestpkg-2.0 +key: newtestpkg-2.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -16,4 +16,4 @@ exposed-modules: A hidden-modules: B, "C.D", "C.E" import-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" library-dirs: /usr/local/lib/testpkg, "c:/Program Files/testpkg" -hs-libraries: testpkg-2.0 +hs-libraries: testpkg-2.0-XXX diff --git a/testsuite/tests/cabal/test7a.pkg b/testsuite/tests/cabal/test7a.pkg index 7eaeea2a8a..ae78add404 100644 --- a/testsuite/tests/cabal/test7a.pkg +++ b/testsuite/tests/cabal/test7a.pkg @@ -1,7 +1,7 @@ name: testpkg7a version: 1.0 id: testpkg7a-1.0-XXX -key: testpkg7a-1.0 +key: testpkg7a-1.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -13,5 +13,5 @@ category: none author: simonmar@microsoft.com exposed: True exposed-modules: E, A from testpkg-1.2.3.4-XXX:A, A1 from testpkg-1.2.3.4-XXX:A, E2 from testpkg7a-1.0-XXX:E -hs-libraries: testpkg7a-1.0 +hs-libraries: testpkg7a-1.0-XXX depends: testpkg-1.2.3.4-XXX diff --git a/testsuite/tests/cabal/test7b.pkg b/testsuite/tests/cabal/test7b.pkg index f0bc6871f0..74b4b86014 100644 --- a/testsuite/tests/cabal/test7b.pkg +++ b/testsuite/tests/cabal/test7b.pkg @@ -1,7 +1,7 @@ name: testpkg7b version: 1.0 id: testpkg7b-1.0-XXX -key: testpkg7b-1.0 +key: testpkg7b-1.0-XXX license: BSD3 copyright: (c) The Univsersity of Glasgow 2004 maintainer: glasgow-haskell-users@haskell.org @@ -13,5 +13,5 @@ category: none author: simonmar@microsoft.com exposed: True exposed-modules: F1 from testpkg-1.2.3.4-XXX:A, F2 from testpkg7a-1.0-XXX:A, F3 from testpkg7a-1.0-XXX:A1, F4 from testpkg7a-1.0-XXX:E, E from testpkg7a-1.0-XXX:E, E3 from testpkg7a-1.0-XXX:E2 -hs-libraries: testpkg7b-1.0 +hs-libraries: testpkg7b-1.0-XXX depends: testpkg-1.2.3.4-XXX, testpkg7a-1.0-XXX diff --git a/testsuite/tests/cabal/testdup.pkg b/testsuite/tests/cabal/testdup.pkg index 0e368e5ae8..bf1db32da4 100644 --- a/testsuite/tests/cabal/testdup.pkg +++ b/testsuite/tests/cabal/testdup.pkg @@ -1,6 +1,6 @@ name: testdup version: 1.0 id: testdup-1.0-XXX -key: testdup-1.0 +key: testdup-1.0-XXX license: BSD3 depends: testpkg-1.2.3.4-XXX testpkg-1.2.3.4-XXX diff --git a/testsuite/tests/codeGen/should_compile/jmp_tbl.hs b/testsuite/tests/codeGen/should_compile/jmp_tbl.hs index 2af97d1d6c..05fabf630c 100644 --- a/testsuite/tests/codeGen/should_compile/jmp_tbl.hs +++ b/testsuite/tests/codeGen/should_compile/jmp_tbl.hs @@ -4,7 +4,7 @@ This funny module was reduced from a failing build of stage2 using the new code generator and the linear register allocator, with this bug: -"inplace/bin/ghc-stage1" -fPIC -dynamic -H32m -O -Wall -H64m -O0 -package-name ghc-7.1.20110414 -hide-all-packages -i -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage2/build -icompiler/stage2/build/autogen -Icompiler/stage2/build -Icompiler/stage2/build/autogen -Icompiler/../libffi/build/include -Icompiler/stage2 -Icompiler/../libraries/base/cbits -Icompiler/../libraries/base/include -Icompiler/. -Icompiler/parser -Icompiler/utils -optP-DGHCI -optP-include -optPcompiler/stage2/build/autogen/cabal_macros.h -package Cabal-1.11.0 -package array-0.3.0.2 -package base-4.3.1.0 -package bin-package-db-0.0.0.0 -package bytestring-0.9.1.10 -package containers-0.4.0.0 -package directory-1.1.0.0 -package filepath-1.2.0.0 -package hoopl-3.8.7.0 -package hpc-0.5.0.6 -package old-time-1.0.0.6 -package process-1.0.1.4 -package template-haskell-2.5.0.0 -package unix-2.4.1.0 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XHaskell98 -XNondecreasingIndentation -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -O2 -O -DGHC_DEFAULT_NEW_CODEGEN -no-user-package-db -rtsopts -odir compiler/stage2/build -hidir compiler/stage2/build -stubdir compiler/stage2/build -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -c compiler/main/DriverPipeline.hs -o compiler/stage2/build/DriverPipeline.dyn_o -fforce-recomp -dno-debug-output -fno-warn-unused-binds +"inplace/bin/ghc-stage1" -fPIC -dynamic -H32m -O -Wall -H64m -O0 -package-name ghc-7.1.20110414 -hide-all-packages -i -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage2/build -icompiler/stage2/build/autogen -Icompiler/stage2/build -Icompiler/stage2/build/autogen -Icompiler/../libffi/build/include -Icompiler/stage2 -Icompiler/../libraries/base/cbits -Icompiler/../libraries/base/include -Icompiler/. -Icompiler/parser -Icompiler/utils -optP-DGHCI -optP-include -optPcompiler/stage2/build/autogen/cabal_macros.h -package Cabal-1.11.0 -package array-0.3.0.2 -package base-4.3.1.0 -package ghc-boot-0.0.0.0 -package bytestring-0.9.1.10 -package containers-0.4.0.0 -package directory-1.1.0.0 -package filepath-1.2.0.0 -package hoopl-3.8.7.0 -package hpc-0.5.0.6 -package old-time-1.0.0.6 -package process-1.0.1.4 -package template-haskell-2.5.0.0 -package unix-2.4.1.0 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XHaskell98 -XNondecreasingIndentation -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -O2 -O -DGHC_DEFAULT_NEW_CODEGEN -no-user-package-db -rtsopts -odir compiler/stage2/build -hidir compiler/stage2/build -stubdir compiler/stage2/build -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -c compiler/main/DriverPipeline.hs -o compiler/stage2/build/DriverPipeline.dyn_o -fforce-recomp -dno-debug-output -fno-warn-unused-binds ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.1.20110414 for x86_64-unknown-linux): diff --git a/testsuite/tests/codeGen/should_run/T10870.hs b/testsuite/tests/codeGen/should_run/T10870.hs new file mode 100644 index 0000000000..642ef2c1ff --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10870.hs @@ -0,0 +1,11 @@ +import Data.Bits +import Data.Int +import Data.Word + +unsafeShift32R :: (Bits a, Num a) => a -> a +unsafeShift32R x = unsafeShiftR x 32 + +main :: IO () +main = do + print $ map unsafeShift32R [ 123456, 0x7fffffff :: Int ] + print $ map unsafeShift32R [ 123456, 0xffffffff :: Word ] diff --git a/testsuite/tests/codeGen/should_run/T10870.stdout b/testsuite/tests/codeGen/should_run/T10870.stdout new file mode 100644 index 0000000000..945f244e36 --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10870.stdout @@ -0,0 +1,2 @@ +[0,0] +[0,0] diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index ab2ce60cca..13eda788de 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -138,3 +138,4 @@ test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], compile_and_run, ['-feager-blackholing']) test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) +test('T10870', normal, compile_and_run, ['']) diff --git a/testsuite/tests/deSugar/should_run/DsStaticPointers.stdout b/testsuite/tests/deSugar/should_run/DsStaticPointers.stdout index 962352684f..0a223db3e2 100644 --- a/testsuite/tests/deSugar/should_run/DsStaticPointers.stdout +++ b/testsuite/tests/deSugar/should_run/DsStaticPointers.stdout @@ -1,5 +1,5 @@ -StaticPtrInfo {spInfoPackageKey = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:1", spInfoSrcLoc = (10,32)} -StaticPtrInfo {spInfoPackageKey = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:2", spInfoSrcLoc = (11,33)} -StaticPtrInfo {spInfoPackageKey = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:0", spInfoSrcLoc = (21,13)} -StaticPtrInfo {spInfoPackageKey = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:3", spInfoSrcLoc = (13,33)} -StaticPtrInfo {spInfoPackageKey = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:4", spInfoSrcLoc = (14,33)} +StaticPtrInfo {spInfoUnitId = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:1", spInfoSrcLoc = (10,32)} +StaticPtrInfo {spInfoUnitId = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:2", spInfoSrcLoc = (11,33)} +StaticPtrInfo {spInfoUnitId = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:0", spInfoSrcLoc = (21,13)} +StaticPtrInfo {spInfoUnitId = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:3", spInfoSrcLoc = (13,33)} +StaticPtrInfo {spInfoUnitId = "main", spInfoModuleName = "Main", spInfoName = "sptEntry:4", spInfoSrcLoc = (14,33)} diff --git a/testsuite/tests/deSugar/should_run/T10215.hs b/testsuite/tests/deSugar/should_run/T10215.hs new file mode 100644 index 0000000000..9a2d224970 --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T10215.hs @@ -0,0 +1,9 @@ +testF :: Float -> Bool +testF x = x == 0 && not (isNegativeZero x) + +testD :: Double -> Bool +testD x = x == 0 && not (isNegativeZero x) + +main :: IO () +main = do print $ testF (-0.0) + print $ testD (-0.0) diff --git a/testsuite/tests/deSugar/should_run/T10215.stdout b/testsuite/tests/deSugar/should_run/T10215.stdout new file mode 100644 index 0000000000..abb239365b --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T10215.stdout @@ -0,0 +1,3 @@ +False +False + diff --git a/testsuite/tests/deSugar/should_run/T9238.hs b/testsuite/tests/deSugar/should_run/T9238.hs new file mode 100644 index 0000000000..79eeeb76af --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T9238.hs @@ -0,0 +1,16 @@ +compareDouble :: Double -> Double -> Ordering +compareDouble x y = + case (isNaN x, isNaN y) of + (True, True) -> EQ + (True, False) -> LT + (False, True) -> GT + (False, False) -> + -- Make -0 less than 0 + case (x == 0, y == 0, isNegativeZero x, isNegativeZero y) of + (True, True, True, False) -> LT + (True, True, False, True) -> GT + _ -> x `compare` y + +main = do + let l = [-0, 0] + print [ (x, y, compareDouble x y) | x <- l, y <- l ] diff --git a/testsuite/tests/deSugar/should_run/T9238.stdout b/testsuite/tests/deSugar/should_run/T9238.stdout new file mode 100644 index 0000000000..8dbd09d20d --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T9238.stdout @@ -0,0 +1,2 @@ +[(-0.0,-0.0,EQ),(-0.0,0.0,LT),(0.0,-0.0,GT),(0.0,0.0,EQ)] + diff --git a/testsuite/tests/deSugar/should_run/all.T b/testsuite/tests/deSugar/should_run/all.T index 228b90dd0f..bc72b01568 100644 --- a/testsuite/tests/deSugar/should_run/all.T +++ b/testsuite/tests/deSugar/should_run/all.T @@ -46,5 +46,7 @@ test('DsStaticPointers', ], compile_and_run, ['']) test('T8952', normal, compile_and_run, ['']) +test('T9238', normal, compile_and_run, ['']) test('T9844', normal, compile_and_run, ['']) +test('T10215', normal, compile_and_run, ['']) test('DsStrictData', normal, compile_and_run, ['']) diff --git a/testsuite/tests/driver/T365.hs b/testsuite/tests/driver/T365.hs new file mode 100644 index 0000000000..fe09bb2fb0 --- /dev/null +++ b/testsuite/tests/driver/T365.hs @@ -0,0 +1,4 @@ +{-# OPTIONS_GHC -F -pgmF ./test_preprocessor.txt #-} +module Main where + +main = print "Hello World" diff --git a/testsuite/tests/driver/T365.stderr b/testsuite/tests/driver/T365.stderr new file mode 100644 index 0000000000..560217e498 --- /dev/null +++ b/testsuite/tests/driver/T365.stderr @@ -0,0 +1 @@ +./test_preprocessor.txt: runInteractiveProcess: invalid argument (Exec format error) diff --git a/testsuite/tests/driver/T8602/T8602.stderr b/testsuite/tests/driver/T8602/T8602.stderr index 3bbfa20e3d..f3bb7e1546 100644 --- a/testsuite/tests/driver/T8602/T8602.stderr +++ b/testsuite/tests/driver/T8602/T8602.stderr @@ -1,2 +1,2 @@ A B C -phase `Haskell pre-processor' failed (exitcode = 1) +`t8602' failed in phase `Haskell pre-processor'. (Exit code: 1) diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 4a4f93003e..17e0784cbc 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -400,7 +400,7 @@ test('T8959a', test('T703', normal, run_command, ['$MAKE -s --no-print-directory T703']) test('T2182', normal, run_command, ['$MAKE -s --no-print-directory T2182']) -test('T8101', normal, compile, ['-Wall -fno-code']) +test('T8101', expect_broken(10600), compile, ['-Wall -fno-code']) test('T8101b', expect_broken(10600), multimod_compile, ['T8101b', '-Wall -fno-code']) @@ -446,3 +446,10 @@ test('T10182', extra_clean(['T10182.o', 'T10182a.o', 'T10182.o-boot', 'T10182.hi', 'T10182a.hi', 'T10182.hi-boot']), run_command, ['$MAKE -s --no-print-directory T10182']) + +test('T365', + [extra_clean(['test_preprocessor.txt']), + pre_cmd('touch test_preprocessor.txt'), + unless(opsys('mingw32'), skip)], + compile_fail, + ['']) diff --git a/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 b/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 index 9fe325728e..898dc7a5c4 100644 --- a/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 +++ b/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 @@ -1,6 +1,7 @@ -[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 ) +[1 of 4] Compiling A ( A.hs, tmp_sigof01m\A.o ) +[2 of 4] Compiling B[boot] ( B.hs-boot, tmp_sigof01m\B.o-boot ) +[3 of 4] Compiling B[merge] ( B.hi, tmp_sigof01m\B.o ) +[4 of 4] Compiling Main ( Main.hs, tmp_sigof01m\Main.o ) Linking tmp_sigof01m/Main.exe ... False T diff --git a/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 b/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 index 3c8a1fa00c..7fde989bc4 100644 --- a/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 +++ b/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 @@ -1,6 +1,8 @@ -[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 ) +[1 of 5] Compiling MapAsSet[boot] ( MapAsSet.hs-boot, tmp_sigof02dm\MapAsSet.o-boot ) +[2 of 5] Compiling MapAsSet[merge] ( MapAsSet.hi, tmp_sigof02dm\MapAsSet.o ) +[3 of 5] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02dm\Map.o-boot ) +[4 of 5] Compiling Map[merge] ( Map.hi, tmp_sigof02dm\Map.o ) +[5 of 5] Compiling Main ( Double.hs, tmp_sigof02dm\Main.o ) Linking tmp_sigof02dm/Double.exe ... False fromList [0,6] diff --git a/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 b/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 index 65b1857c49..f7cca89866 100644 --- a/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 +++ b/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 @@ -1,8 +1,10 @@ -[1 of 2] Compiling Map[sig of Data.Map.Strict] ( Map.hsig, nothing ) -[2 of 2] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) +[1 of 3] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02m\Map.o-boot ) +[2 of 3] Compiling Map[merge] ( Map.hi, tmp_sigof02m\Map.o ) +[3 of 3] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) Linking tmp_sigof02m/StrictMain.exe ... -[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] +[1 of 3] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02m\Map.o-boot ) [sig-of changed] +[2 of 3] Compiling Map[merge] ( Map.hi, tmp_sigof02m\Map.o ) [sig-of changed] +[3 of 3] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) [Map changed] Linking tmp_sigof02m/LazyMain.exe ... False [(0,"foo"),(6,"foo")] diff --git a/testsuite/tests/gadt/records-fail1.hs b/testsuite/tests/gadt/records-fail1.hs index b26404afd3..12bb3e0cd3 100644 --- a/testsuite/tests/gadt/records-fail1.hs +++ b/testsuite/tests/gadt/records-fail1.hs @@ -10,7 +10,7 @@ -- It's been removed in August 2015 -- see Phab D1118 --- test should result into parse error +-- test should result in a parse error module ShouldFail where diff --git a/testsuite/tests/generics/GEq/GEq1.hs b/testsuite/tests/generics/GEq/GEq1.hs index 164535cddb..d6ca0b057e 100644 --- a/testsuite/tests/generics/GEq/GEq1.hs +++ b/testsuite/tests/generics/GEq/GEq1.hs @@ -1,7 +1,9 @@ -{-# LANGUAGE TypeOperators, DeriveGeneric, TypeFamilies, FlexibleInstances #-} +{-# LANGUAGE TypeOperators, DeriveGeneric, TypeFamilies, + FlexibleInstances, MagicHash #-} module Main where +import GHC.Exts import GHC.Generics hiding (C, D) import GEq1A @@ -20,6 +22,13 @@ data family F a b :: * -> * data instance F Int b c = F b Int c deriving Generic +data U a = U a Addr# Char# Double# Float# Int# Word# + deriving Generic + +data family UF a b :: * -> * +data instance UF Int b c = UF b c Addr# Char# Double# Float# Int# Word# + deriving Generic + -- Example values c0 = C0 c1 = C1 @@ -35,17 +44,27 @@ f1 :: F Int Float Char f1 = F 0.0 3 'h' f2 = F 0.0 4 'h' +u0 :: U Int +u0 = U 1 "1"# '1'# 1.0## 1.0# 1# 1## + +uf0 :: UF Int Int Int +uf0 = UF 2 2 "1"# '2'# 2.0## 2.0# 2# 2## + -- Generic instances instance GEq C instance (GEq a) => GEq (D a) instance (GEq a, GEq b) => GEq (a :**: b) instance (GEq b, GEq c) => GEq (F Int b c) +instance (GEq a) => GEq (U a) +instance (GEq b, GEq c) => GEq (UF Int b c) -- Tests -teq0 = geq c0 c1 -teq1 = geq d0 d1 -teq2 = geq d0 d0 -teq3 = geq p1 p1 -teq4 = geq f1 f2 +teq0 = geq c0 c1 +teq1 = geq d0 d1 +teq2 = geq d0 d0 +teq3 = geq p1 p1 +teq4 = geq f1 f2 +teq5 = geq u0 u0 +teq6 = geq uf0 uf0 -main = mapM_ print [teq0, teq1, teq2, teq3, teq4] +main = mapM_ print [teq0, teq1, teq2, teq3, teq4, teq5, teq6] diff --git a/testsuite/tests/generics/GEq/GEq1.stdout b/testsuite/tests/generics/GEq/GEq1.stdout index 3ce45b831d..e590e50cd2 100644 --- a/testsuite/tests/generics/GEq/GEq1.stdout +++ b/testsuite/tests/generics/GEq/GEq1.stdout @@ -3,3 +3,5 @@ False True True False +True +True diff --git a/testsuite/tests/generics/GEq/GEq1A.hs b/testsuite/tests/generics/GEq/GEq1A.hs index 7bdfbebe54..9a91e8040b 100644 --- a/testsuite/tests/generics/GEq/GEq1A.hs +++ b/testsuite/tests/generics/GEq/GEq1A.hs @@ -1,7 +1,9 @@ -{-# LANGUAGE TypeOperators, DefaultSignatures, FlexibleContexts, FlexibleInstances #-} +{-# LANGUAGE TypeOperators, DefaultSignatures, + FlexibleContexts, FlexibleInstances, MagicHash #-} module GEq1A where +import GHC.Exts import GHC.Generics class GEq' f where @@ -26,13 +28,25 @@ instance (GEq' a, GEq' b) => GEq' (a :+: b) where instance (GEq' a, GEq' b) => GEq' (a :*: b) where geq' (a1 :*: b1) (a2 :*: b2) = geq' a1 a2 && geq' b1 b2 - -class GEq a where +-- Unboxed types +instance GEq' UAddr where + geq' (UAddr a1) (UAddr a2) = isTrue# (eqAddr# a1 a2) +instance GEq' UChar where + geq' (UChar c1) (UChar c2) = isTrue# (eqChar# c1 c2) +instance GEq' UDouble where + geq' (UDouble d1) (UDouble d2) = isTrue# (d1 ==## d2) +instance GEq' UFloat where + geq' (UFloat f1) (UFloat f2) = isTrue# (eqFloat# f1 f2) +instance GEq' UInt where + geq' (UInt i1) (UInt i2) = isTrue# (i1 ==# i2) +instance GEq' UWord where + geq' (UWord w1) (UWord w2) = isTrue# (eqWord# w1 w2) + +class GEq a where geq :: a -> a -> Bool default geq :: (Generic a, GEq' (Rep a)) => a -> a -> Bool geq x y = geq' (from x) (from y) - -- Base types instances (ad-hoc) instance GEq Char where geq = (==) instance GEq Int where geq = (==) diff --git a/testsuite/tests/generics/GShow/GShow.hs b/testsuite/tests/generics/GShow/GShow.hs index 3c8f2591ef..6cdda282d8 100644 --- a/testsuite/tests/generics/GShow/GShow.hs +++ b/testsuite/tests/generics/GShow/GShow.hs @@ -5,13 +5,14 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE IncoherentInstances #-} -- :-/ {-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE MagicHash #-} module GShow ( -- * Generic show class GShow(..) ) where - +import GHC.Exts import GHC.Generics -------------------------------------------------------------------------------- @@ -36,10 +37,10 @@ instance (GShow c) => GShow' (K1 i c) where -- No instances for P or Rec because gshow is only applicable to types of kind * instance (GShow' a, Constructor c) => GShow' (M1 C c a) where - gshowsPrec' _ n c@(M1 x) = + gshowsPrec' _ n c@(M1 x) = case (fixity, conIsTuple c) of - (Prefix,False) -> showParen (n > 10 && not (isNullary x)) - ( showString (conName c) + (Prefix,False) -> showParen (n > 10 && not (isNullary x)) + ( showString (conName c) . if (isNullary x) then id else showChar ' ' . showBraces t (gshowsPrec' t 10 x)) (Prefix,True) -> showParen (n > 10) (showBraces t (gshowsPrec' t 10 x)) @@ -58,7 +59,7 @@ instance (GShow' a, Constructor c) => GShow' (M1 C c a) where conIsTuple c = case conName c of ('(':',':_) -> True otherwise -> False - + isNullary (M1 x) = isNullary x instance (Selector s, GShow' a) => GShow' (M1 S s a) where @@ -85,12 +86,23 @@ instance (GShow' a, GShow' b) => GShow' (a :*: b) where gshowsPrec' t n a . showChar ',' . gshowsPrec' t n b gshowsPrec' t@Pref n (a :*: b) = gshowsPrec' t (n+1) a . showChar ' ' . gshowsPrec' t (n+1) b - + -- If we have a product then it is not a nullary constructor isNullary _ = False - -class GShow a where +-- Unboxed instances +instance GShow' UChar where + gshowsPrec' _ _ (UChar c) = showsPrec 0 (C# c) . showChar '#' +instance GShow' UDouble where + gshowsPrec' _ _ (UDouble d) = showsPrec 0 (D# d) . showString "##" +instance GShow' UFloat where + gshowsPrec' _ _ (UFloat f) = showsPrec 0 (F# f) . showChar '#' +instance GShow' UInt where + gshowsPrec' _ _ (UInt i) = showsPrec 0 (I# i) . showChar '#' +instance GShow' UWord where + gshowsPrec' _ _ (UWord w) = showsPrec 0 (W# w) . showString "##" + +class GShow a where gshowsPrec :: Int -> a -> ShowS default gshowsPrec :: (Generic a, GShow' (Rep a)) => Int -> a -> ShowS gshowsPrec n = gshowsPrec' Pref n . from @@ -100,13 +112,15 @@ class GShow a where gshow :: a -> String gshow x = gshows x "" - + -- Base types instances instance GShow Char where gshowsPrec = showsPrec +instance GShow Double where gshowsPrec = showsPrec instance GShow Int where gshowsPrec = showsPrec instance GShow Float where gshowsPrec = showsPrec instance GShow String where gshowsPrec = showsPrec +instance GShow Word where gshowsPrec = showsPrec instance GShow Bool where gshowsPrec = showsPrec intersperse :: a -> [a] -> [a] diff --git a/testsuite/tests/generics/GShow/GShow1.stdout b/testsuite/tests/generics/GShow/GShow1.stdout index 6109e446a5..71e1299245 100644 --- a/testsuite/tests/generics/GShow/GShow1.stdout +++ b/testsuite/tests/generics/GShow/GShow1.stdout @@ -1,3 +1,4 @@ D0 D1 {d11 = Just 'p', d12 = D0} D1 {d11 = (3,0.14), d12 = D0} +U (1) ('1'#) (-1.0##) (-1.0#) (-1#) (1##) diff --git a/testsuite/tests/generics/GShow/Main.hs b/testsuite/tests/generics/GShow/Main.hs index 81768ed647..952602e54d 100644 --- a/testsuite/tests/generics/GShow/Main.hs +++ b/testsuite/tests/generics/GShow/Main.hs @@ -1,12 +1,14 @@ -{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveGeneric, MagicHash #-} module Main where +import GHC.Exts import GHC.Generics hiding (C, D) import GShow -- We should be able to generate a generic representation for these types data D a = D0 | D1 { d11 :: a, d12 :: (D a) } deriving Generic +data U a = U a Char# Double# Float# Int# Word# deriving Generic -- Example values d0 :: D Char @@ -16,8 +18,12 @@ d1 = D1 (Just 'p') D0 d2 :: D (Int,Float) d2 = D1 (3,0.14) D0 +u0 :: U Int +u0 = U 1 '1'# -1.0## -1.0# -1# 1## + -- Generic instances instance (GShow a) => GShow (D a) +instance (GShow a) => GShow (U a) -- Tests -main = mapM_ putStrLn [gshow d0, gshow d1, gshow d2] +main = mapM_ putStrLn [gshow d0, gshow d1, gshow d2, gshow u0] diff --git a/testsuite/tests/generics/T10361a.hs b/testsuite/tests/generics/T10361a.hs new file mode 100644 index 0000000000..cc5fbb9dca --- /dev/null +++ b/testsuite/tests/generics/T10361a.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TypeFamilies #-} +module T10361a where + +class C1 a where + type T1 a + type instance T1 a = Char + +class C2 a where -- equivalent to C1 + type T2 a + type instance T2 a = Char + +class C3 a where -- equivalent to C1, C2 + type T3 a + type instance T3 a = Char + +data A = B + deriving C1 + +deriving instance C2 A + +instance C3 A + +test1 :: T1 A +test1 = 'x' + +test2 :: T2 A +test2 = 'x' + +test3 :: T3 A +test3 = 'x' diff --git a/testsuite/tests/generics/T10361b.hs b/testsuite/tests/generics/T10361b.hs new file mode 100644 index 0000000000..6ecd99e644 --- /dev/null +++ b/testsuite/tests/generics/T10361b.hs @@ -0,0 +1,58 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UndecidableInstances #-} + +module T10361b where + +import GHC.Generics + +--------------------------------------------------------------------- +class Convert a where + type Result a + type instance Result a = GResult (Rep a) + + convert :: a -> Result a + default convert :: (Generic a, GConvert (Rep a)) => a -> GResult (Rep a) + convert x = gconvert (from x) + +instance Convert Float where + type Result Float = Float + convert = id + +instance Convert Int where + type Result Int = Int + convert = id + +--------------------------------------------------------------------- +class GConvert f where + type GResult f + gconvert :: f p -> GResult f + +instance (Convert c) => GConvert (K1 i c) where + type GResult (K1 i c) = Result c + gconvert (K1 x) = convert x + +instance (GConvert f) => GConvert (M1 i t f) where + type GResult (M1 i t f) = GResult f + gconvert (M1 x) = gconvert x + +instance (GConvert f, GConvert g) => GConvert (f :*: g) where + type GResult (f :*: g) = (GResult f, GResult g) + gconvert (x :*: y) = (gconvert x, gconvert y) + +--------------------------------------------------------------------- + +data Data1 = Data1 Int Float + deriving (Generic) + +instance Convert Data1 + +val :: (Int, Float) +val = convert $ Data1 0 0.0 + +data Data2 = Data2 Int Float + deriving (Generic, Convert) diff --git a/testsuite/tests/generics/T8468.stderr b/testsuite/tests/generics/T8468.stderr index 62536cec69..aaf68b9d5a 100644 --- a/testsuite/tests/generics/T8468.stderr +++ b/testsuite/tests/generics/T8468.stderr @@ -1,5 +1,5 @@ T8468.hs:6:42: Can't make a derived instance of ‘Generic1 Array’: - Array must not have unlifted or polymorphic arguments + Array must not have exotic unlifted or polymorphic arguments In the data declaration for ‘Array’ diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T index 31a6809c82..cbf70cf8bf 100644 --- a/testsuite/tests/generics/all.T +++ b/testsuite/tests/generics/all.T @@ -40,3 +40,5 @@ test('T8468', normal, compile_fail, ['']) test('T8479', normal, compile, ['']) test('T9563', normal, compile, ['']) test('T10030', normal, compile_and_run, ['']) +test('T10361a', normal, compile, ['']) +test('T10361b', normal, compile, ['']) diff --git a/testsuite/tests/ghci.debugger/scripts/break006.stderr b/testsuite/tests/ghci.debugger/scripts/break006.stderr index bf96e55e9e..b6e3cc9b12 100644 --- a/testsuite/tests/ghci.debugger/scripts/break006.stderr +++ b/testsuite/tests/ghci.debugger/scripts/break006.stderr @@ -4,7 +4,7 @@ Cannot resolve unknown runtime type ‘t1’ Use :print or :force to determine these types Relevant bindings include it :: t1 (bound at <interactive>:5:1) - Potential instances: + These potential instances exist: instance (Show a, Show b) => Show (Either a b) -- Defined in ‘Data.Either’ instance Show All -- Defined in ‘Data.Monoid’ @@ -21,7 +21,7 @@ Cannot resolve unknown runtime type ‘t1’ Use :print or :force to determine these types Relevant bindings include it :: t1 (bound at <interactive>:7:1) - Potential instances: + These potential instances exist: instance (Show a, Show b) => Show (Either a b) -- Defined in ‘Data.Either’ instance Show All -- Defined in ‘Data.Monoid’ diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr index 5c1822456e..894c553805 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stderr +++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr @@ -4,7 +4,7 @@ Cannot resolve unknown runtime type ‘a1’ Use :print or :force to determine these types Relevant bindings include it :: a1 (bound at <interactive>:10:1) - Potential instances: + These potential instances exist: instance Show TyCon -- Defined in ‘Data.Typeable.Internal’ instance Show TypeRep -- Defined in ‘Data.Typeable.Internal’ instance Show Ordering -- Defined in ‘GHC.Show’ diff --git a/testsuite/tests/ghci/linking/Makefile b/testsuite/tests/ghci/linking/Makefile index 5b8e23c66c..c833454ea7 100644 --- a/testsuite/tests/ghci/linking/Makefile +++ b/testsuite/tests/ghci/linking/Makefile @@ -40,7 +40,11 @@ ghcilink002 : .PHONY: ghcilink003 ghcilink003 : +ifeq "$(WINDOWS)" "YES" + echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -lstdc++-6 +else echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -lstdc++ +endif # Test 4: # package P @@ -114,7 +118,11 @@ ghcilink006 : echo "version: 1.0" >>$(PKG006) echo "id: test-XXX" >>$(PKG006) echo "key: test-1.0" >>$(PKG006) +ifeq "$(WINDOWS)" "YES" + echo "extra-libraries: stdc++-6" >>$(PKG006) +else echo "extra-libraries: stdc++" >>$(PKG006) +endif '$(GHC_PKG)' init $(LOCAL_PKGCONF006) '$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF006) register $(PKG006) -v0 # diff --git a/testsuite/tests/ghci/linking/T1407.script b/testsuite/tests/ghci/linking/T1407.script deleted file mode 100644 index 97164359d0..0000000000 --- a/testsuite/tests/ghci/linking/T1407.script +++ /dev/null @@ -1,4 +0,0 @@ -:set -ldl -import Foreign -import Foreign.C.String -foreign import ccall "dlerror" dle :: IO CString diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 4d05b8f355..7404de3923 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -12,8 +12,6 @@ test('ghcilink002', test('ghcilink003', [ - # still cannot load libstdc++ on Windows. See also #4468. - when(opsys('mingw32'), expect_broken(5289)), unless(doing_ghci, skip), extra_clean(['dir003/*','dir003']) ], @@ -36,8 +34,6 @@ test('ghcilink005', test('ghcilink006', [ - # still cannot load libstdc++ on Windows. See also #4468. - when(opsys('mingw32'), expect_broken(5289)), unless(doing_ghci, skip), extra_clean(['dir006/ghcilink006.package.conf/*', 'dir006/*','dir006']) ], @@ -47,9 +43,7 @@ test('ghcilink006', test('T3333', [extra_clean(['T3333.o']), unless(doing_ghci, skip), - unless(opsys('linux') or ghci_dynamic(), expect_broken(3333))], + unless(opsys('linux') or opsys('darwin') or ghci_dynamic(), expect_broken(3333))], run_command, ['$MAKE -s --no-print-directory T3333']) -test('T1407', when(opsys('mingw32'), expect_broken(1407)), - ghci_script, ['T1407.script']) diff --git a/testsuite/tests/ghci/linking/dyn/A.c b/testsuite/tests/ghci/linking/dyn/A.c new file mode 100644 index 0000000000..fec94f2829 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/A.c @@ -0,0 +1,17 @@ +#if defined(_MSC_VER) + // Microsoft + #define EXPORT __declspec(dllexport) +#elif defined(_GCC) + // GCC + #define EXPORT __attribute__((visibility("default"))) +#else + // do nothing and hope for the best? + #define EXPORT +#endif + +extern EXPORT int foo(); + +EXPORT int foo() +{ + return 2; +} diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile new file mode 100644 index 0000000000..8a3b7363e4 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -0,0 +1,23 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +ifeq "$(WINDOWS)" "YES" +DLL = lib$1.dll +else ifeq "$(DARWIN)" "YES" +DLL = lib$1.dylib +else +DLL = lib$1.so +endif + + +.PHONY: load_short_name +load_short_name: + rm -rf bin_short + mkdir bin_short + gcc -shared A.c -o "bin_short/$(call DLL,A)" + echo ":q" | "$(TEST_HC)" --interactive -L"$(PWD)/bin_short" -lA -v0 + +.PHONY: compile_libAS +compile_libAS: + gcc -shared A.c -o $(call DLL,AS) diff --git a/testsuite/tests/ghci/linking/dyn/T1407.script b/testsuite/tests/ghci/linking/dyn/T1407.script new file mode 100644 index 0000000000..0274f8245d --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/T1407.script @@ -0,0 +1,4 @@ +:set -lAS +import Foreign +import Foreign.C.Types +foreign import ccall "foo" dle :: IO CInt diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T new file mode 100644 index 0000000000..2810c7f29f --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -0,0 +1,12 @@ +test('load_short_name', + [unless(doing_ghci, skip), + extra_clean(['bin_short/*', 'bin_short'])], + run_command, + ['$MAKE -s --no-print-directory load_short_name']) + +test('T1407', + [unless(doing_ghci, skip), + extra_clean(['libAS.*']), + pre_cmd('$MAKE -s --no-print-directory compile_libAS'), + extra_hc_opts('-L.')], + ghci_script, ['T1407.script']) diff --git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr index b2a5efefc3..4888e6958c 100644 --- a/testsuite/tests/ghci/scripts/Defer02.stderr +++ b/testsuite/tests/ghci/scripts/Defer02.stderr @@ -67,9 +67,10 @@ In an equation for ‘j’: j = myOp 23 ../../typecheck/should_run/Defer01.hs:43:10: warning: - No instance for (Num a1) arising from the literal ‘23’ - The type variable ‘a1’ is ambiguous - Potential instances: + Ambiguous type variable ‘a1’ arising from the literal ‘23’ + prevents the constraint ‘(Num a1)’ from being solved. + Probable fix: use a type annotation to specify what ‘a1’ should be. + These potential instances exist: instance Num Integer -- Defined in ‘GHC.Num’ instance Num Double -- Defined in ‘GHC.Float’ instance Num Float -- Defined in ‘GHC.Float’ diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr index b4abfbd99c..cafb6a4992 100644 --- a/testsuite/tests/ghci/scripts/T5979.stderr +++ b/testsuite/tests/ghci/scripts/T5979.stderr @@ -1,7 +1,7 @@ -<no location info>: +<no location info>: error: Could not find module ‘Control.Monad.Trans.State’ Perhaps you meant - Control.Monad.Trans.State (from transformers-<VERSION>@<HASH>) - Control.Monad.Trans.Class (from transformers-<VERSION>@<HASH>) - Control.Monad.Trans.Cont (from transformers-<VERSION>@<HASH>) + 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) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index d2244c1790..d58b2dc0aa 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -1,8 +1,5 @@ # coding=utf8 -def normaliseTransformersPackageKey(str): - return re.sub('transformers-[^@]+@[A-Za-z0-9]+', 'transformers-<VERSION>@<HASH>', str) - setTestOpts(when(compiler_profiled(), skip)) test('ghci001', combined_output, ghci_script, ['ghci001.script']) @@ -126,7 +123,7 @@ test('T5836', normal, ghci_script, ['T5836.script']) test('T5979', [reqlib('transformers'), normalise_slashes, - normalise_errmsg_fun(normaliseTransformersPackageKey)], + normalise_version("transformers")], ghci_script, ['T5979.script']) test('T5975a', [pre_cmd('touch föøbàr1.hs'), @@ -208,8 +205,7 @@ test('T9878', [extra_clean(['T9878.hi','T9878.o'])], ghci_script, ['T9878.script']) test('T9878b', - [ when(opsys('mingw32'), expect_broken(9878)), - extra_run_opts('-fobject-code'), + [ extra_run_opts('-fobject-code'), extra_clean(['T9878b.hi','T9878b.o'])], ghci_script, ['T9878b.script']) test('T10018', normal, ghci_script, ['T10018.script']) diff --git a/testsuite/tests/indexed-types/should_compile/T10931.hs b/testsuite/tests/indexed-types/should_compile/T10931.hs new file mode 100644 index 0000000000..2c0ea204d3 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T10931.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE RankNTypes #-} + +{-# OPTIONS_GHC -Wall #-} + +module T10931 ( BugC(..) ) where + +data IdT f a = IdC (f a) + +class ( m ~ Outer m (Inner m) ) => BugC (m :: * -> *) where + type Inner m :: * -> * + type Outer m :: (* -> *) -> * -> * + + bug :: ( forall n. ( n ~ Outer n (Inner n) + , Outer n ~ Outer m + ) + => Inner n a) + -> m a + +instance BugC (IdT m) where + type Inner (IdT m) = m + type Outer (IdT m) = IdT + + bug f = IdC f diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index b98f963f61..39b8a3a476 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -264,3 +264,4 @@ test('T10713', normal, compile, ['']) test('T10753', normal, compile, ['']) test('T10806', normal, compile_fail, ['']) test('T10815', normal, compile, ['']) +test('T10931', normal, compile, ['']) diff --git a/testsuite/tests/indexed-types/should_fail/T4485.stderr b/testsuite/tests/indexed-types/should_fail/T4485.stderr index f05eeace6e..92d8efc3cd 100644 --- a/testsuite/tests/indexed-types/should_fail/T4485.stderr +++ b/testsuite/tests/indexed-types/should_fail/T4485.stderr @@ -19,9 +19,10 @@ T4485.hs:50:15: error: asChild b = asChild $ (genElement "foo") T4485.hs:50:26: error: - No instance for (XMLGen m0) arising from a use of ‘genElement’ - The type variable ‘m0’ is ambiguous - Potential instances: + Ambiguous type variable ‘m0’ arising from a use of ‘genElement’ + prevents the constraint ‘(XMLGen m0)’ from being solved. + Probable fix: use a type annotation to specify what ‘m0’ should be. + These potential instance exist: instance XMLGen (IdentityT m) -- Defined at T4485.hs:37:10 In the second argument of ‘($)’, namely ‘(genElement "foo")’ In the expression: asChild $ (genElement "foo") diff --git a/testsuite/tests/numeric/should_compile/T10929.hs b/testsuite/tests/numeric/should_compile/T10929.hs new file mode 100644 index 0000000000..47e00719c4 --- /dev/null +++ b/testsuite/tests/numeric/should_compile/T10929.hs @@ -0,0 +1,31 @@ +module T10929 where + +x1 :: [Integer] +x1 = [5 .. 3] + +x2 :: [Integer] +x2 = [3 .. 5] + +x3 :: [Integer] +x3 = [5, 3 .. 1] + +x4 :: [Integer] +x4 = [5, (3+0) .. 1] + +x5 :: [Integer] +x5 = [1, 3 .. 5] + +x6 :: [Integer] +x6 = [1, (3+0) .. 5] + +x7 :: [Integer] +x7 = [5, 7 .. 1] + +x8 :: [Integer] +x8 = [5, (7+0) .. 1] + +x9 :: [Integer] +x9 = [3, 1 .. 5] + +x10 :: [Integer] +x10 = [3, (1+0) .. 5] diff --git a/testsuite/tests/numeric/should_compile/T10929.stderr b/testsuite/tests/numeric/should_compile/T10929.stderr new file mode 100644 index 0000000000..8723c42a9a --- /dev/null +++ b/testsuite/tests/numeric/should_compile/T10929.stderr @@ -0,0 +1,6 @@ + +T10929.hs:4:6: warning: Enumeration is empty + +T10929.hs:22:6: warning: Enumeration is empty + +T10929.hs:28:6: warning: Enumeration is empty diff --git a/testsuite/tests/numeric/should_compile/all.T b/testsuite/tests/numeric/should_compile/all.T index 246642f263..ea42aad5d8 100644 --- a/testsuite/tests/numeric/should_compile/all.T +++ b/testsuite/tests/numeric/should_compile/all.T @@ -2,3 +2,4 @@ test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116']) test('T7895', normal, compile, ['']) test('T7881', normal, compile, ['']) test('T8542', normal, compile, ['']) +test('T10929', normal, compile, ['']) diff --git a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr index 75abc3b0e6..7faa9207a4 100644 --- a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr +++ b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr @@ -1,8 +1,9 @@ overloadedlistsfail01.hs:5:8: error: - No instance for (Show a0) arising from a use of ‘print’ - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from a use of ‘print’ + prevents the constraint ‘(Show a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance [safe] Show Version -- Defined in ‘Data.Version’ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ @@ -12,9 +13,10 @@ overloadedlistsfail01.hs:5:8: error: In an equation for ‘main’: main = print [1] overloadedlistsfail01.hs:5:14: error: - No instance for (IsList a0) arising from an overloaded list - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from an overloaded list + prevents the constraint ‘(IsList a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance IsList Version -- Defined in ‘GHC.Exts’ instance IsList [a] -- Defined in ‘GHC.Exts’ In the first argument of ‘print’, namely ‘[1]’ @@ -22,9 +24,10 @@ overloadedlistsfail01.hs:5:14: error: In an equation for ‘main’: main = print [1] overloadedlistsfail01.hs:5:15: error: - No instance for (Num (Item a0)) arising from the literal ‘1’ - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num (Item a0))’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance Num Integer -- Defined in ‘GHC.Num’ instance Num Double -- Defined in ‘GHC.Float’ instance Num Float -- Defined in ‘GHC.Float’ diff --git a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr index 5a3f1cc080..5eb8b539a3 100644 --- a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr +++ b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr @@ -1,2 +1,2 @@ -ParserNoLambdaCase.hs:3:5: parse error: naked lambda expression '' +ParserNoLambdaCase.hs:3:6: error: parse error on input ‘case’ diff --git a/testsuite/tests/parser/should_fail/T10498a.hs b/testsuite/tests/parser/should_fail/T10498a.hs new file mode 100644 index 0000000000..5a9656f254 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE LambdaCase #-} +module T10498a where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498a.hs:10:5: +-- parse error in if statement: missing required else clause + +foo = + if True + then + \case -> + 1 -> 2 + else id diff --git a/testsuite/tests/parser/should_fail/T10498a.stderr b/testsuite/tests/parser/should_fail/T10498a.stderr new file mode 100644 index 0000000000..8b866f35f2 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.stderr @@ -0,0 +1,2 @@ + +T10498a.hs:12:15: error: parse error on input ‘->’ diff --git a/testsuite/tests/parser/should_fail/T10498b.hs b/testsuite/tests/parser/should_fail/T10498b.hs new file mode 100644 index 0000000000..19b62af5aa --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.hs @@ -0,0 +1,7 @@ +module T10498b where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498b.hs:7:5: parse error in if statement: naked if statement + +f = if module then True else False diff --git a/testsuite/tests/parser/should_fail/T10498b.stderr b/testsuite/tests/parser/should_fail/T10498b.stderr new file mode 100644 index 0000000000..e15343b891 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.stderr @@ -0,0 +1,2 @@ + +T10498b.hs:7:8: error: parse error on input ‘module’ diff --git a/testsuite/tests/parser/should_fail/T8430.stderr b/testsuite/tests/parser/should_fail/T8430.stderr index 2d7b703e51..5bfc8a40c0 100644 --- a/testsuite/tests/parser/should_fail/T8430.stderr +++ b/testsuite/tests/parser/should_fail/T8430.stderr @@ -1,2 +1,3 @@ T8430.lhs line 3: unlit: spurious \end{code} +`unlit' failed in phase `Literate pre-processor'. (Exit code: 1) diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 33da7217a7..13fb7385a2 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -91,3 +91,5 @@ test('T9225', normal, compile_fail, ['']) test('T10196Fail1', normal, compile_fail, ['']) test('T10196Fail2', normal, compile_fail, ['']) test('T10196Fail3', expect_broken(10196), compile_fail, ['']) +test('T10498a', normal, compile_fail, ['']) +test('T10498b', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/readFail020.stderr b/testsuite/tests/parser/should_fail/readFail020.stderr index 0c00cdc79b..0697604181 100644 --- a/testsuite/tests/parser/should_fail/readFail020.stderr +++ b/testsuite/tests/parser/should_fail/readFail020.stderr @@ -1,3 +1,2 @@ -readFail020.hs:3:5: - parse error in let binding: missing required 'in' +readFail020.hs:3:16: error: parse error on input ‘}’ diff --git a/testsuite/tests/patsyn/should_compile/T10747.hs b/testsuite/tests/patsyn/should_compile/T10747.hs new file mode 100644 index 0000000000..b02d8d0d87 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T10747.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE PatternSynonyms #-} + +module T10747 where + +pattern head `Cons` tail = head : tail diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index b0776ac9a4..5e86a99cca 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -24,3 +24,4 @@ test('T9889', normal, compile, ['']) test('T9867', normal, compile, ['']) test('T9975a', normal, compile_fail, ['']) test('T9975b', normal, compile, ['']) +test('T10747', normal, compile, ['']) diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index 1e5a16c9c7..c7a60e3830 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -5,7 +5,7 @@ test('haddock.base', [unless(in_tree_compiler(), skip), req_haddock ,stats_num_field('bytes allocated', - [(wordsize(64), 9418857192, 5) + [(wordsize(64), 9894189856, 5) # 2012-08-14: 5920822352 (amd64/Linux) # 2012-09-20: 5829972376 (amd64/Linux) # 2012-10-08: 5902601224 (amd64/Linux) @@ -24,6 +24,7 @@ test('haddock.base', # 2014-12-14: 9502647104 (x86_64/Linux) - Update to Haddock 2.16 # 2014-01-08: 9014511528 (x86_64/Linux) - Eliminate so-called "silent superclass parameters" (and others) # 2015-07-22: 9418857192 (x86_64/Linux) - Just slowly creeping up. + # 2015-10-03: 9894189856 (x86_64/Linux) - Still creeping ,(platform('i386-unknown-mingw32'), 4434804940, 5) # 2013-02-10: 3358693084 (x86/Windows) diff --git a/testsuite/tests/polykinds/T10934.hs b/testsuite/tests/polykinds/T10934.hs new file mode 100644 index 0000000000..fb7a538ebd --- /dev/null +++ b/testsuite/tests/polykinds/T10934.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE + ScopedTypeVariables + , DataKinds + , GADTs + , RankNTypes + , TypeOperators + , PolyKinds -- Comment out PolyKinds and the bug goes away. + #-} +{-# OPTIONS_GHC -O #-} + -- The bug is in SimplUtils.abstractFloats, so we need -O to trigger it + +module KeyValue where + +data AccValidation err a = AccFailure err | AccSuccess a + +data KeyValueError = MissingValue + +type WithKeyValueError = AccValidation [KeyValueError] + +missing :: forall f rs. RecApplicative rs => Rec (WithKeyValueError :. f) rs +missing = rpure missingField + where + missingField :: forall x. (WithKeyValueError :. f) x + missingField = Compose $ AccFailure [MissingValue] + +data Rec :: (u -> *) -> [u] -> * where + RNil :: Rec f '[] + (:&) :: !(f r) -> !(Rec f rs) -> Rec f (r ': rs) + +newtype Compose (f :: l -> *) (g :: k -> l) (x :: k) + = Compose { getCompose :: f (g x) } + +type (:.) f g = Compose f g + +class RecApplicative rs where + rpure + :: (forall x. f x) + -> Rec f rs diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index c073c1b344..b1e0793a4e 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -121,3 +121,4 @@ test('T10670', normal, compile, ['']) test('T10670a', normal, compile, ['']) test('T10134', normal, multimod_compile, ['T10134.hs','-v0']) test('T10742', normal, compile, ['']) +test('T10934', normal, compile, ['']) diff --git a/testsuite/tests/quotes/TH_localname.stderr b/testsuite/tests/quotes/TH_localname.stderr index c764f576ef..dfb1e41383 100644 --- a/testsuite/tests/quotes/TH_localname.stderr +++ b/testsuite/tests/quotes/TH_localname.stderr @@ -1,11 +1,12 @@ TH_localname.hs:3:11: error: - No instance for (Lift t0) arising from a use of ‘lift’ - The type variable ‘t0’ is ambiguous + Ambiguous type variable ‘t0’ arising from a use of ‘lift’ + prevents the constraint ‘(Lift t0)’ from being solved. Relevant bindings include y :: t0 (bound at TH_localname.hs:3:6) x :: t0 -> ExpQ (bound at TH_localname.hs:3:1) - Potential instances: + Probable fix: use a type annotation to specify what ‘t0’ should be. + These potential instances exist: instance (Lift a, Lift b) => Lift (Either a b) -- Defined in ‘Language.Haskell.TH.Syntax’ instance Lift Int16 -- Defined in ‘Language.Haskell.TH.Syntax’ diff --git a/testsuite/tests/rebindable/rebindable6.stderr b/testsuite/tests/rebindable/rebindable6.stderr index b843f33bd7..cf280a961d 100644 --- a/testsuite/tests/rebindable/rebindable6.stderr +++ b/testsuite/tests/rebindable/rebindable6.stderr @@ -1,15 +1,16 @@ rebindable6.hs:106:17: error: - No instance for (HasSeq (IO a -> t0 -> IO b)) - arising from a do statement + Ambiguous type variable ‘t0’ arising from a do statement + prevents the constraint ‘(HasSeq + (IO a -> t0 -> IO b))’ from being solved. (maybe you haven't applied a function to enough arguments?) - The type variable ‘t0’ is ambiguous Relevant bindings include g :: IO (Maybe b) (bound at rebindable6.hs:104:19) f :: IO a (bound at rebindable6.hs:104:17) test_do :: IO a -> IO (Maybe b) -> IO b (bound at rebindable6.hs:104:9) - Potential instances: + Probable fix: use a type annotation to specify what ‘t0’ should be. + These potential instance exist: instance HasSeq (IO a -> IO b -> IO b) -- Defined at rebindable6.hs:52:18 In a stmt of a 'do' block: f @@ -24,11 +25,12 @@ rebindable6.hs:106:17: error: return b } rebindable6.hs:107:17: error: - No instance for (HasFail ([Char] -> t1)) - arising from a do statement + Ambiguous type variable ‘t1’ arising from a do statement + prevents the constraint ‘(HasFail + ([Char] -> t1))’ from being solved. (maybe you haven't applied a function to enough arguments?) - The type variable ‘t1’ is ambiguous - Potential instances: + Probable fix: use a type annotation to specify what ‘t1’ should be. + These potential instance exist: instance HasFail (String -> IO a) -- Defined at rebindable6.hs:57:18 In a stmt of a 'do' block: Just (b :: b) <- g @@ -43,16 +45,16 @@ rebindable6.hs:107:17: error: return b } rebindable6.hs:108:17: error: - No instance for (HasReturn (b -> t1)) - arising from a use of ‘return’ + Ambiguous type variable ‘t1’ arising from a use of ‘return’ + prevents the constraint ‘(HasReturn (b -> t1))’ from being solved. (maybe you haven't applied a function to enough arguments?) - The type variable ‘t1’ is ambiguous Relevant bindings include b :: b (bound at rebindable6.hs:107:23) g :: IO (Maybe b) (bound at rebindable6.hs:104:19) test_do :: IO a -> IO (Maybe b) -> IO b (bound at rebindable6.hs:104:9) - Potential instances: + Probable fix: use a type annotation to specify what ‘t1’ should be. + These potential instance exist: instance HasReturn (a -> IO a) -- Defined at rebindable6.hs:42:18 In a stmt of a 'do' block: return b In the expression: diff --git a/testsuite/tests/rename/prog006/Makefile b/testsuite/tests/rename/prog006/Makefile index 41c33c8765..0012e50bad 100644 --- a/testsuite/tests/rename/prog006/Makefile +++ b/testsuite/tests/rename/prog006/Makefile @@ -28,12 +28,12 @@ rn.prog006: rm -f pkg.conf rm -f pwd pwd.exe pwd.exe.manifest pwd.hi pwd.o '$(TEST_HC)' $(TEST_HC_OPTS) --make pwd -v0 - '$(TEST_HC)' $(TEST_HC_OPTS) --make -this-package-key test-1.0 B.C -fforce-recomp -v0 $(RM_PROG006_EXTRA_FLAGS) + '$(TEST_HC)' $(TEST_HC_OPTS) --make -this-package-key test-1.0-XXX B.C -fforce-recomp -v0 $(RM_PROG006_EXTRA_FLAGS) rm -f pkg.conf echo "name: test" >>pkg.conf echo "version: 1.0" >>pkg.conf - echo "id: test-XXX" >>pkg.conf - echo "key: test-1.0" >>pkg.conf + echo "id: test-1.0-XXX" >>pkg.conf + echo "key: test-1.0-XXX" >>pkg.conf echo "import-dirs: `./pwd`" >>pkg.conf echo "exposed-modules: B.C" >>pkg.conf rm -rf $(LOCAL_PKGCONF) diff --git a/testsuite/tests/rename/should_fail/mc14.stderr b/testsuite/tests/rename/should_fail/mc14.stderr index bb02f9bafb..bc7b7df291 100644 --- a/testsuite/tests/rename/should_fail/mc14.stderr +++ b/testsuite/tests/rename/should_fail/mc14.stderr @@ -1,7 +1,9 @@ + mc14.hs:14:16: error: - No instance for (Functor t0) arising from a use of ‘fmap’ - The type variable ‘t0’ is ambiguous - Potential instances: + Ambiguous type variable ‘t0’ arising from a use of ‘fmap’ + prevents the constraint ‘(Functor t0)’ from being solved. + Probable fix: use a type annotation to specify what ‘t0’ should be. + These potential instances exist: instance Functor IO -- Defined in ‘GHC.Base’ instance Functor Maybe -- Defined in ‘GHC.Base’ instance Functor ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/rts/T10672/Main.hs b/testsuite/tests/rts/T10672/Main.hs new file mode 100644 index 0000000000..eb07b8cfea --- /dev/null +++ b/testsuite/tests/rts/T10672/Main.hs @@ -0,0 +1,14 @@ +-- Copyright (C) 2015, Luke Iannini + +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE ForeignFunctionInterface #-} + +module Main where +import Printf ( pr ) + +foreign import ccall "talkToCxx" talkToCxx :: IO () + +main :: IO () +main = do + putStrLn ( $(pr "Hello From Template Haskell!") ) + talkToCxx diff --git a/testsuite/tests/rts/T10672/Makefile b/testsuite/tests/rts/T10672/Makefile new file mode 100644 index 0000000000..5fc458857e --- /dev/null +++ b/testsuite/tests/rts/T10672/Makefile @@ -0,0 +1,11 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T10672_x64: + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -rtsopts=none -fforce-recomp -lgcc_s_seh-1 -lstdc++-6 \ + Main.hs Printf.hs cxxy.cpp + +T10672_x86: + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -rtsopts=none -fforce-recomp -lgcc_s_dw2-1 -lstdc++-6 \ + Main.hs Printf.hs cxxy.cpp diff --git a/testsuite/tests/rts/T10672/Printf.hs b/testsuite/tests/rts/T10672/Printf.hs new file mode 100644 index 0000000000..046f9a07eb --- /dev/null +++ b/testsuite/tests/rts/T10672/Printf.hs @@ -0,0 +1,34 @@ +-- Copyright (C) 2015, Luke Iannini + +{-# LANGUAGE TemplateHaskell #-} +module Printf where + +-- Skeletal printf from the paper: +-- http://research.microsoft.com/pubs/67015/meta-haskell.pdf +-- It needs to be in a separate module to the one where +-- you intend to use it. + +-- Import some Template Haskell syntax +import Language.Haskell.TH + +-- Describe a format string +data Format = D | S | L String + +-- Parse a format string. This is left largely to you +-- as we are here interested in building our first ever +-- Template Haskell program and not in building printf. +parse :: String -> [Format] +parse s = [ L s ] + +-- Generate Haskell source code from a parsed representation +-- of the format string. This code will be spliced into +-- the module which calls "pr", at compile time. +gen :: [Format] -> Q Exp +gen [D] = [| \n -> show n |] +gen [S] = [| \s -> s |] +gen [L s] = stringE s + +-- Here we generate the Haskell code for the splice +-- from an input format string. +pr :: String -> Q Exp +pr s = gen (parse s) diff --git a/testsuite/tests/rts/T10672/all.T b/testsuite/tests/rts/T10672/all.T new file mode 100644 index 0000000000..4367b0a497 --- /dev/null +++ b/testsuite/tests/rts/T10672/all.T @@ -0,0 +1,11 @@ +test('T10672_x64', [extra_clean(['cxxy.o', + 'Main.exe', 'Main.hi', 'Main.o', + 'Printf.o', 'Printf.hi']), + [unless(opsys('mingw32'),skip) , unless(arch('x86_64'), skip)]], + run_command, ['$MAKE -s --no-print-directory T10672_x64']) + +test('T10672_x86', [extra_clean(['cxxy.o', + 'Main.exe', 'Main.hi', 'Main.o', + 'Printf.o', 'Printf.hi']), + [unless(opsys('mingw32'),skip) , unless(arch('i386'), skip)]], + run_command, ['$MAKE -s --no-print-directory T10672_x86']) diff --git a/testsuite/tests/rts/T10672/cxxy.cpp b/testsuite/tests/rts/T10672/cxxy.cpp new file mode 100644 index 0000000000..815d15399e --- /dev/null +++ b/testsuite/tests/rts/T10672/cxxy.cpp @@ -0,0 +1,23 @@ +// Copyright (C) 2015, Luke Iannini
+
+#include <iostream>
+#include <exception>
+#include <string.h>
+
+// Make sure can call unmangled names from Haskell's FFI
+extern "C" {
+
+int talkToCxx() {
+
+ try {
+ throw 20;
+ }
+ catch (int e) {
+ std::cout << "An exception occurred. Exception Nr. " << e << '\n';
+ }
+
+ std::cout << "Hello From C++!";
+}
+
+
+}
diff --git a/testsuite/tests/rts/linker_error.c b/testsuite/tests/rts/linker_error.c index 715eabd184..264c95d710 100644 --- a/testsuite/tests/rts/linker_error.c +++ b/testsuite/tests/rts/linker_error.c @@ -51,12 +51,12 @@ int main (int argc, char *argv[]) for (i=0; i < ITERATIONS; i++) { r = loadObj(obj); if (!r) { - debugBelch("loadObj(%s) failed", obj); + debugBelch("loadObj(%s) failed\n", obj); continue; } r = resolveObjs(); if (!r) { - debugBelch("resolveObjs failed"); + debugBelch("resolveObjs failed\n"); unloadObj(obj); continue; } diff --git a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr index a89ff72d04..5616259ee3 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr +++ b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr @@ -1,6 +1,6 @@ <no location info>: error: - The package (bytestring-0.10.6.0) is required to be trusted but it isn't! + The package (base-4.8.2.0) is required to be trusted but it isn't! <no location info>: error: - The package (base-4.8.2.0) is required to be trusted but it isn't! + The package (bytestring-0.10.6.0) is required to be trusted but it isn't! diff --git a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr index f4013c0a90..5616259ee3 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr +++ b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr @@ -1,6 +1,6 @@ -<no location info>: - The package (bytestring-0.10.5.0) is required to be trusted but it isn't! - -<no location info>: +<no location info>: error: The package (base-4.8.2.0) is required to be trusted but it isn't! + +<no location info>: error: + The package (bytestring-0.10.6.0) is required to be trusted but it isn't! diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T index 5f337370af..aea4406986 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/all.T +++ b/testsuite/tests/safeHaskell/check/pkg01/all.T @@ -29,7 +29,8 @@ make_args = 'VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn test('safePkg01', [clean_cmd('$MAKE -s --no-print-directory cleanPackageDatabase.safePkg01'), normalise_errmsg_fun(ignoreLdOutput), - normalise_version("array", "integer-gmp", "integer-simple", "bytestring"), + normalise_version("array", "integer-gmp", "integer-simple", "bytestring", + "base", "deepseq", "ghc-prim"), ], run_command, ['$MAKE -s --no-print-directory safePkg01 ' + make_args]) @@ -91,13 +92,13 @@ test('ImpSafeOnly06', test('ImpSafeOnly07', [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly07 ' + make_args), clean_cmd('$MAKE -s --no-print-directory cleanPackageDatabase.ImpSafeOnly07'), - normalise_version("bytestring")], + normalise_version("bytestring", "base")], compile_fail, ['-fpackage-trust -package-db pdb.ImpSafeOnly07/local.db -trust safePkg01 -distrust bytestring']) test('ImpSafeOnly08', [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly08 ' + make_args), clean_cmd('$MAKE -s --no-print-directory cleanPackageDatabase.ImpSafeOnly08'), - normalise_version("bytestring")], + normalise_version("bytestring", "base")], compile_fail, ['-fpackage-trust -package-db pdb.ImpSafeOnly08/local.db -trust safePkg01']) test('ImpSafeOnly09', diff --git a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout index a3810ffb8b..62f18d1392 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout +++ b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout @@ -29,17 +29,17 @@ trusted: safe require own pkg trusted: True M_SafePkg6 -package dependencies: bytestring-0.10.6.0* deepseq-1.4.1.1 array-0.5.1.0 base-4.8.2.0* ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 +package dependencies: array-0.5.1.0 base-4.8.2.0* bytestring-0.10.6.0* deepseq-1.4.1.1 ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 trusted: trustworthy require own pkg trusted: False M_SafePkg7 -package dependencies: bytestring-0.10.6.0* deepseq-1.4.1.1 array-0.5.1.0 base-4.8.2.0* ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 +package dependencies: array-0.5.1.0 base-4.8.2.0* bytestring-0.10.6.0* deepseq-1.4.1.1 ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 trusted: safe require own pkg trusted: False M_SafePkg8 -package dependencies: bytestring-0.10.6.0* deepseq-1.4.1.1 array-0.5.1.0 base-4.8.2.0 ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 +package dependencies: array-0.5.1.0 base-4.8.2.0 bytestring-0.10.6.0* deepseq-1.4.1.1 ghc-prim-0.4.0.0 integer-gmp-1.0.0.0 trusted: trustworthy require own pkg trusted: False diff --git a/testsuite/tests/simplCore/should_compile/T7785.stderr b/testsuite/tests/simplCore/should_compile/T7785.stderr index f0b9117543..db80b9965b 100644 --- a/testsuite/tests/simplCore/should_compile/T7785.stderr +++ b/testsuite/tests/simplCore/should_compile/T7785.stderr @@ -4,7 +4,5 @@ forall ($dMyFunctor :: MyFunctor []) (irred :: Domain [] Int). shared @ [] $dMyFunctor irred = bar_$sshared -"SPEC/Foo myfmap @ []" [ALWAYS] - forall (tpl :: MyFunctor []). myfmap @ [] tpl = $cmyfmap diff --git a/testsuite/tests/th/T10279.stderr b/testsuite/tests/th/T10279.stderr index c5f7834eae..21688ae836 100644 --- a/testsuite/tests/th/T10279.stderr +++ b/testsuite/tests/th/T10279.stderr @@ -1,8 +1,8 @@ T10279.hs:10:10: error: Failed to load interface for ‘A’ - no package key matching ‘rts-1.0’ was found - (This package key looks like the source package ID; - the real package key is ‘rts’) + no unit id matching ‘rts-1.0’ was found + (This unit ID looks like the source package ID; + the real unit ID is ‘rts’) In the expression: (rts-1.0:A.Foo) In an equation for ‘blah’: blah = (rts-1.0:A.Foo) diff --git a/testsuite/tests/th/T10796a.hs b/testsuite/tests/th/T10796a.hs new file mode 100644 index 0000000000..6c1ac8c78c --- /dev/null +++ b/testsuite/tests/th/T10796a.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TemplateHaskell #-} +module T10796a where + +import Data.Ratio +import Data.Set (Set, fromList) +import Language.Haskell.TH.Syntax (liftData) + +-- Data instance with toConstr implemented using a variable, +-- not a data constructor +splicedSet :: Set Char +splicedSet = $(liftData (fromList "test")) + +-- Infix data constructor +splicedRatio :: Ratio Int +splicedRatio = $(liftData (1 % 2 :: Ratio Int)) diff --git a/testsuite/tests/th/T10796b.hs b/testsuite/tests/th/T10796b.hs new file mode 100644 index 0000000000..3da40633a8 --- /dev/null +++ b/testsuite/tests/th/T10796b.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} +module T10796b where + +import Data.Set (Set, fromList) +import Language.Haskell.TH.Quote (dataToPatQ) + +badPattern :: Set Char -> Set Char +badPattern s@($(dataToPatQ (const Nothing) (fromList "test"))) = s diff --git a/testsuite/tests/th/T10796b.stderr b/testsuite/tests/th/T10796b.stderr new file mode 100644 index 0000000000..1dd5110bbf --- /dev/null +++ b/testsuite/tests/th/T10796b.stderr @@ -0,0 +1,5 @@ + +T10796b.hs:8:17: error: + Can't construct a pattern from name Data.Set.Base.fromList + In the untyped splice: + $(dataToPatQ (const Nothing) (fromList "test")) diff --git a/testsuite/tests/th/T10945.hs b/testsuite/tests/th/T10945.hs new file mode 100644 index 0000000000..be7a792d61 --- /dev/null +++ b/testsuite/tests/th/T10945.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10945 where + +import Language.Haskell.TH + +$$(return [ + SigD (mkName "m") + (ForallT [PlainTV (mkName "a")] + [] + (AppT (AppT ArrowT (VarT (mkName "a"))) (VarT (mkName "a")))) + , FunD (mkName "m") + [Clause [VarP (mkName "x")] (NormalB (VarE (mkName "x"))) []] + ]) diff --git a/testsuite/tests/th/T10946.hs b/testsuite/tests/th/T10946.hs new file mode 100644 index 0000000000..e234d9185b --- /dev/null +++ b/testsuite/tests/th/T10946.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10946 where + +import Language.Haskell.TH + +m :: a -> a +m x = $$([||_||]) diff --git a/testsuite/tests/th/TH_Roles2.stderr b/testsuite/tests/th/TH_Roles2.stderr index 8611b92691..8f078ba901 100644 --- a/testsuite/tests/th/TH_Roles2.stderr +++ b/testsuite/tests/th/TH_Roles2.stderr @@ -4,9 +4,9 @@ TYPE CONSTRUCTORS data T (a :: k) COERCION AXIOMS Dependent modules: [] -Dependent packages: [pretty-1.1.2.0, deepseq-1.4.1.1, - array-0.5.1.0, base-4.8.2.0, ghc-prim-0.4.0.0, integer-gmp-1.0.0.0, - template-haskell-2.11.0.0] +Dependent packages: [array-0.5.1.0, base-4.8.2.0, deepseq-1.4.1.1, + ghc-boot-0.0.0.0, ghc-prim-0.4.0.0, integer-gmp-1.0.0.0, + pretty-1.1.2.0, template-haskell-2.11.0.0] ==================== Typechecker ==================== diff --git a/testsuite/tests/th/TH_nameSpace.hs b/testsuite/tests/th/TH_nameSpace.hs new file mode 100644 index 0000000000..42e7503f95 --- /dev/null +++ b/testsuite/tests/th/TH_nameSpace.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TemplateHaskell #-} +module Main where + +import Data.Maybe (Maybe(..)) +import Data.Ord (Ord) +import Language.Haskell.TH (mkName, nameSpace) + +main :: IO () +main = mapM_ (print . nameSpace) + [ 'Prelude.id + , mkName "id" + , 'Data.Maybe.Just + , ''Data.Maybe.Maybe + , ''Data.Ord.Ord + ] diff --git a/testsuite/tests/th/TH_nameSpace.stdout b/testsuite/tests/th/TH_nameSpace.stdout new file mode 100644 index 0000000000..a7b2cd768a --- /dev/null +++ b/testsuite/tests/th/TH_nameSpace.stdout @@ -0,0 +1,5 @@ +Just VarName +Nothing +Just DataName +Just TcClsName +Just TcClsName diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 9d4736c10f..9ded8108df 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -357,6 +357,11 @@ test('T10704', ['T10704', '-v0']) test('T6018th', normal, compile_fail, ['-v0']) test('TH_namePackage', normal, compile_and_run, ['-v0']) +test('TH_nameSpace', normal, compile_and_run, ['-v0']) +test('T10796a', normal, compile, ['-v0']) +test('T10796b', normal, compile_fail, ['-v0']) test('T10811', normal, compile, ['-v0']) test('T10810', normal, compile, ['-v0']) test('T10891', normal, compile, ['-v0']) +test('T10945', expect_broken(10945), compile, ['-v0']) +test('T10946', expect_broken(10946), compile, ['-v0']) diff --git a/testsuite/tests/typecheck/should_compile/T10935.hs b/testsuite/tests/typecheck/should_compile/T10935.hs new file mode 100644 index 0000000000..9817ec8d54 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10935.hs @@ -0,0 +1,5 @@ +{-# OPTIONS_GHC -fwarn-monomorphism-restriction #-} + +module T10935 where + +f x = let y = x+1 in (y,y) diff --git a/testsuite/tests/typecheck/should_compile/T10935.stderr b/testsuite/tests/typecheck/should_compile/T10935.stderr new file mode 100644 index 0000000000..2279cfc90b --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10935.stderr @@ -0,0 +1,6 @@ + +T10935.hs:5:11: warning: + The Monomorphism Restriction applies to the binding for ‘y’ + Consider giving a type signature for ‘y’ + In the expression: let y = x + 1 in (y, y) + In an equation for ‘f’: f x = let y = x + 1 in (y, y) diff --git a/testsuite/tests/typecheck/should_compile/T4912.stderr b/testsuite/tests/typecheck/should_compile/T4912.stderr index 855d365db5..02ff1ad40e 100644 --- a/testsuite/tests/typecheck/should_compile/T4912.stderr +++ b/testsuite/tests/typecheck/should_compile/T4912.stderr @@ -1,12 +1,12 @@ -T4912.hs:10:10: warning: - Orphan instance: instance [safe] Foo TheirData +T4912.hs:10:1: warning: + Orphan instance: instance Foo TheirData To avoid this move the instance declaration to the module of the class or of the type, or wrap the type with a newtype and declare the instance on the new type. -T4912.hs:13:10: warning: - Orphan instance: instance [safe] Bar OurData +T4912.hs:13:1: warning: + Orphan instance: instance Bar OurData To avoid this move the instance declaration to the module of the class or of the type, or wrap the type with a newtype and declare the instance on the new type. diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 8f6aeae9b5..42af77aeb4 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -477,3 +477,4 @@ test('update-existential', normal, compile, ['']) test('T10347', expect_broken(10347), compile, ['']) test('T10770a', expect_broken(10770), compile, ['']) test('T10770b', expect_broken(10770), compile, ['']) +test('T10935', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/holes2.stderr b/testsuite/tests/typecheck/should_compile/holes2.stderr index ad5b530fae..ee3d627438 100644 --- a/testsuite/tests/typecheck/should_compile/holes2.stderr +++ b/testsuite/tests/typecheck/should_compile/holes2.stderr @@ -1,8 +1,9 @@ holes2.hs:3:5: warning: - No instance for (Show a0) arising from a use of ‘show’ - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from a use of ‘show’ + prevents the constraint ‘(Show a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance Show Ordering -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ diff --git a/testsuite/tests/typecheck/should_fail/T4921.stderr b/testsuite/tests/typecheck/should_fail/T4921.stderr index 091d461328..42d5a8a363 100644 --- a/testsuite/tests/typecheck/should_fail/T4921.stderr +++ b/testsuite/tests/typecheck/should_fail/T4921.stderr @@ -1,18 +1,20 @@ T4921.hs:10:9: error: - No instance for (C a0 b1) arising from a use of ‘f’ - The type variables ‘b1’, ‘a0’ are ambiguous + Ambiguous type variables ‘b1’, ‘a0’ arising from a use of ‘f’ + prevents the constraint ‘(C a0 b1)’ from being solved. Relevant bindings include x :: a0 (bound at T4921.hs:10:1) - Potential instances: + Probable fix: use a type annotation to specify what ‘b1’, ‘a0’ should be. + These potential instance exist: instance C Int Char -- Defined at T4921.hs:7:10 In the first argument of ‘fst’, namely ‘f’ In the expression: fst f In an equation for ‘x’: x = fst f T4921.hs:12:9: error: - No instance for (C Int b0) arising from a use of ‘f’ - The type variable ‘b0’ is ambiguous - Potential instances: + Ambiguous type variable ‘b0’ arising from a use of ‘f’ + prevents the constraint ‘(C Int b0)’ from being solved. + Probable fix: use a type annotation to specify what ‘b0’ should be. + These potential instance exist: instance C Int Char -- Defined at T4921.hs:7:10 In the first argument of ‘fst’, namely ‘f’ In the expression: fst f :: Int diff --git a/testsuite/tests/typecheck/should_fail/T5858.stderr b/testsuite/tests/typecheck/should_fail/T5858.stderr index 9c381d9bf6..7d974d88b7 100644 --- a/testsuite/tests/typecheck/should_fail/T5858.stderr +++ b/testsuite/tests/typecheck/should_fail/T5858.stderr @@ -1,9 +1,10 @@ T5858.hs:11:7: error: - No instance for (InferOverloaded ([t0], [t1])) - arising from a use of ‘infer’ - The type variables ‘t0’, ‘t1’ are ambiguous - Potential instances: + Ambiguous type variables ‘t0’, ‘t1’ arising from a use of ‘infer’ + prevents the constraint ‘(InferOverloaded + ([t0], [t1]))’ from being solved. + Probable fix: use a type annotation to specify what ‘t0’, ‘t1’ should be. + These potential instance exist: instance (t1 ~ String) => InferOverloaded (t1, t1) -- Defined at T5858.hs:8:10 In the expression: infer ([], []) diff --git a/testsuite/tests/typecheck/should_fail/T7857.stderr b/testsuite/tests/typecheck/should_fail/T7857.stderr index f413eb50f2..e923a02472 100644 --- a/testsuite/tests/typecheck/should_fail/T7857.stderr +++ b/testsuite/tests/typecheck/should_fail/T7857.stderr @@ -5,7 +5,7 @@ T7857.hs:8:11: error: bound by the inferred type of g :: PrintfArg t => t -> b at T7857.hs:8:1-21 The type variable ‘r0’ is ambiguous - Potential instances: + These potential instances exist: instance [safe] (a ~ ()) => PrintfType (IO a) -- Defined in ‘Text.Printf’ instance [safe] (PrintfArg a, PrintfType r) => PrintfType (a -> r) diff --git a/testsuite/tests/typecheck/should_fail/tcfail008.stderr b/testsuite/tests/typecheck/should_fail/tcfail008.stderr index db70a632f4..d84c3b90e3 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail008.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail008.stderr @@ -1,9 +1,10 @@ tcfail008.hs:3:5: error: - No instance for (Num a0) arising from the literal ‘1’ - The type variable ‘a0’ is ambiguous + Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num a0)’ from being solved. Relevant bindings include o :: [a0] (bound at tcfail008.hs:3:1) - Potential instances: + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance Num Integer -- Defined in ‘GHC.Num’ instance Num Double -- Defined in ‘GHC.Float’ instance Num Float -- Defined in ‘GHC.Float’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail040.stderr b/testsuite/tests/typecheck/should_fail/tcfail040.stderr index 68e958ecab..6e0da922c5 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail040.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail040.stderr @@ -1,8 +1,9 @@ tcfail040.hs:19:5: error: - No instance for (ORD a0) arising from a use of ‘<<’ - The type variable ‘a0’ is ambiguous - Potential instances: + Ambiguous type variable ‘a0’ arising from a use of ‘<<’ + prevents the constraint ‘(ORD a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instance exist: instance ORD (a -> b) -- Defined at tcfail040.hs:17:10 In the first argument of ‘(===)’, namely ‘(<<)’ In the expression: (<<) === (<<) diff --git a/testsuite/tests/typecheck/should_fail/tcfail043.stderr b/testsuite/tests/typecheck/should_fail/tcfail043.stderr index fe24adc4e4..c30b5bf854 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail043.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail043.stderr @@ -1,12 +1,13 @@ tcfail043.hs:38:17: error: - No instance for (Ord_ a0) arising from a use of ‘gt’ - The type variable ‘a0’ is ambiguous + Ambiguous type variable ‘a0’ arising from a use of ‘gt’ + prevents the constraint ‘(Ord_ a0)’ from being solved. Relevant bindings include bs :: [a0] (bound at tcfail043.hs:38:8) a :: a0 (bound at tcfail043.hs:38:6) search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1) - Potential instances: + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instance exist: instance Ord_ Int -- Defined at tcfail043.hs:34:10 In the expression: gt (hd bs) a In the expression: @@ -22,13 +23,14 @@ tcfail043.hs:38:17: error: if eq a (hd bs) then True else search a (tl bs) tcfail043.hs:40:25: error: - No instance for (Eq_ a0) arising from a use of ‘eq’ - The type variable ‘a0’ is ambiguous + Ambiguous type variable ‘a0’ arising from a use of ‘eq’ + prevents the constraint ‘(Eq_ a0)’ from being solved. Relevant bindings include bs :: [a0] (bound at tcfail043.hs:38:8) a :: a0 (bound at tcfail043.hs:38:6) search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1) - Potential instances: + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: instance Eq_ Int -- Defined at tcfail043.hs:20:10 instance Eq_ a => Eq_ [a] -- Defined at tcfail043.hs:23:10 In the expression: eq a (hd bs) diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr index 3f40718428..65b157332d 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr @@ -6,7 +6,7 @@ tcfail072.hs:23:13: error: g :: (Ord p, Ord q) => AB p q -> Bool at tcfail072.hs:22:6-38 The type variable ‘p0’ is ambiguous - Potential instances: + These potential instances exist: instance Ord Ordering -- Defined in ‘GHC.Classes’ instance Ord Integer -- Defined in ‘integer-gmp-1.0.0.0:GHC.Integer.Type’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail128.stderr b/testsuite/tests/typecheck/should_fail/tcfail128.stderr index 4ad7273c0b..1aab117592 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail128.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail128.stderr @@ -1,9 +1,10 @@ tcfail128.hs:18:16: error: - No instance for (Data.Array.Base.MArray b0 FlatVector IO) - arising from a use of ‘thaw’ - The type variable ‘b0’ is ambiguous - Potential instances: + Ambiguous type variable ‘b0’ arising from a use of ‘thaw’ + prevents the constraint ‘(Data.Array.Base.MArray + b0 FlatVector IO)’ from being solved. + Probable fix: use a type annotation to specify what ‘b0’ should be. + These potential instance exist: instance Data.Array.Base.MArray IOArray e IO -- Defined in ‘Data.Array.Base’ In a stmt of a 'do' block: v <- thaw tmp diff --git a/testsuite/tests/typecheck/should_fail/tcfail133.stderr b/testsuite/tests/typecheck/should_fail/tcfail133.stderr index bba5889603..f61320f4c1 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail133.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail133.stderr @@ -3,9 +3,10 @@ tcfail133.hs:2:61: warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. tcfail133.hs:68:7: error: - No instance for (Show r0) arising from a use of ‘show’ - The type variable ‘r0’ is ambiguous - Potential instances: + Ambiguous type variable ‘r0’ arising from a use of ‘show’ + prevents the constraint ‘(Show r0)’ from being solved. + Probable fix: use a type annotation to specify what ‘r0’ should be. + These potential instances exist: instance Show Ordering -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ instance (Show a, Show b, Number a, Digit b) => Show (a :@ b) diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr index 70dbbd5508..47aeccc586 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr @@ -6,7 +6,7 @@ tcfail181.hs:17:9: error: wog :: Monad m => t -> Something (m Bool) e at tcfail181.hs:17:1-30 The type variable ‘m0’ is ambiguous - Potential instances: + These potential instances exist: instance Monad IO -- Defined in ‘GHC.Base’ instance Monad Maybe -- Defined in ‘GHC.Base’ instance Monad ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/warnings/should_compile/T10890/A.hs b/testsuite/tests/warnings/should_compile/T10890/A.hs new file mode 100644 index 0000000000..c88ccc5b68 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/A.hs @@ -0,0 +1,4 @@ +module A where + +class A a where + has :: a diff --git a/testsuite/tests/warnings/should_compile/T10890/B.hs b/testsuite/tests/warnings/should_compile/T10890/B.hs new file mode 100644 index 0000000000..cfc279019a --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/B.hs @@ -0,0 +1,4 @@ +module B where + +class B a where + has :: a diff --git a/testsuite/tests/warnings/should_compile/T10890/Base.hs b/testsuite/tests/warnings/should_compile/T10890/Base.hs new file mode 100644 index 0000000000..f56bd9ad60 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/Base.hs @@ -0,0 +1,6 @@ +module Base (AClass(..), BClass()) where + +import Extends (BClass ()) + +class AClass a where + has :: a diff --git a/testsuite/tests/warnings/should_compile/T10890/Extends.hs b/testsuite/tests/warnings/should_compile/T10890/Extends.hs new file mode 100644 index 0000000000..a81013e490 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/Extends.hs @@ -0,0 +1,4 @@ +module Extends where + +class BClass b where + has :: b diff --git a/testsuite/tests/warnings/should_compile/T10890/Makefile b/testsuite/tests/warnings/should_compile/T10890/Makefile new file mode 100644 index 0000000000..1c39d1c1fe --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/Makefile @@ -0,0 +1,3 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/warnings/should_compile/T10890/T10890.hs b/testsuite/tests/warnings/should_compile/T10890/T10890.hs new file mode 100644 index 0000000000..a6c0751927 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/T10890.hs @@ -0,0 +1,23 @@ +module Main where + +-- Previously GHC was printing this warning: +-- +-- Main.hs:5:1: Warning: +-- The import of ‘A.has’ from module ‘A’ is redundant +-- +-- Main.hs:6:1: Warning: +-- The import of ‘B.has’ from module ‘B’ is redundant + +import A (A (has)) +import B (B (has)) + +data Blah = Blah + +instance A Blah where + has = Blah + +instance B Blah where + has = Blah + +main :: IO () +main = return () diff --git a/testsuite/tests/warnings/should_compile/T10890/T10890_1.hs b/testsuite/tests/warnings/should_compile/T10890/T10890_1.hs new file mode 100644 index 0000000000..7614ee3fa5 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/T10890_1.hs @@ -0,0 +1,22 @@ +module Main where + +import Base +import Extends + +-- Previously GHC was giving this false positive: +-- +-- T10890_1.hs:4:1: Warning: +-- The import of ‘Extends’ is redundant +-- except perhaps to import instances from ‘Extends’ +-- To import instances alone, use: import Extends() + +data Bar = Bar + +instance AClass Bar where + has = Bar + +instance BClass Bar where + has = Bar + +main :: IO () +main = return () diff --git a/testsuite/tests/warnings/should_compile/T10890/all.T b/testsuite/tests/warnings/should_compile/T10890/all.T new file mode 100644 index 0000000000..3e323f0ed0 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/T10890/all.T @@ -0,0 +1,7 @@ +test('T10890', + extra_clean(['A.o', 'A.hi', 'B.o', 'B.hi']), + multimod_compile, ['T10890', '-v0 -fwarn-unused-imports']) + +test('T10890_1', + extra_clean(['Base.o', 'Base.hi', 'Extends.o', 'Extends.hi']), + multimod_compile, ['T10890_1', '-v0 -fwarn-unused-imports']) diff --git a/testsuite/tests/warnings/should_compile/T9178.stderr b/testsuite/tests/warnings/should_compile/T9178.stderr index c1e99bc516..d22f428763 100644 --- a/testsuite/tests/warnings/should_compile/T9178.stderr +++ b/testsuite/tests/warnings/should_compile/T9178.stderr @@ -1,8 +1,8 @@ [1 of 2] Compiling T9178DataType ( T9178DataType.hs, T9178DataType.o ) [2 of 2] Compiling T9178 ( T9178.hs, T9178.o ) -T9178.hs:8:10: warning: - Orphan instance: instance [safe] Show T9178_Type +T9178.hs:8:1: warning: + Orphan instance: instance Show T9178_Type To avoid this move the instance declaration to the module of the class or of the type, or wrap the type with a newtype and declare the instance on the new type. |