diff options
Diffstat (limited to 'testsuite/tests/driver')
31 files changed, 154 insertions, 2 deletions
diff --git a/testsuite/tests/driver/boot5688/A.hs b/testsuite/tests/driver/boot5688/A.hs new file mode 100644 index 0000000000..3b8b80d6ca --- /dev/null +++ b/testsuite/tests/driver/boot5688/A.hs @@ -0,0 +1,12 @@ +module A where + +-- E source imports B +-- In interface file see source module dependencies: B {-# SOURCE #-} +import E +-- C imports B +-- In interface file see source module dependencies: B +import C + +-- Instance for B only available from B.hi not B.hi-boot, so tests we load +-- that. +main = print B diff --git a/testsuite/tests/driver/boot5688/B.hs b/testsuite/tests/driver/boot5688/B.hs new file mode 100644 index 0000000000..e8458aa739 --- /dev/null +++ b/testsuite/tests/driver/boot5688/B.hs @@ -0,0 +1,8 @@ +module B where + +import D + +data B = B + +instance Show B where + show B = "B" diff --git a/testsuite/tests/driver/boot5688/B.hs-boot b/testsuite/tests/driver/boot5688/B.hs-boot new file mode 100644 index 0000000000..64e74c695a --- /dev/null +++ b/testsuite/tests/driver/boot5688/B.hs-boot @@ -0,0 +1,3 @@ +module B where + +data B = B diff --git a/testsuite/tests/driver/boot5688/C.hs b/testsuite/tests/driver/boot5688/C.hs new file mode 100644 index 0000000000..158757ed80 --- /dev/null +++ b/testsuite/tests/driver/boot5688/C.hs @@ -0,0 +1,3 @@ +module C where + +import B diff --git a/testsuite/tests/driver/boot5688/D.hs b/testsuite/tests/driver/boot5688/D.hs new file mode 100644 index 0000000000..01b53223f9 --- /dev/null +++ b/testsuite/tests/driver/boot5688/D.hs @@ -0,0 +1,3 @@ +module D where + +import {-# SOURCE #-} B diff --git a/testsuite/tests/driver/boot5688/E.hs b/testsuite/tests/driver/boot5688/E.hs new file mode 100644 index 0000000000..a5f78cab2a --- /dev/null +++ b/testsuite/tests/driver/boot5688/E.hs @@ -0,0 +1,3 @@ +module E(B(B)) where + +import {-# SOURCE #-} B diff --git a/testsuite/tests/driver/boot5688/Makefile b/testsuite/tests/driver/boot5688/Makefile new file mode 100644 index 0000000000..74deae442c --- /dev/null +++ b/testsuite/tests/driver/boot5688/Makefile @@ -0,0 +1,10 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +clean: + rm -f *.o *.hi *.hi-boot *.o-boot + +boot5688: clean + '$(TEST_HC)' $(TEST_HC_OPTS) --make A.hs -fno-code -fwrite-interface + '$(TEST_HC)' $(TEST_HC_OPTS) -c A.hs diff --git a/testsuite/tests/driver/boot5688/all.T b/testsuite/tests/driver/boot5688/all.T new file mode 100644 index 0000000000..97c8003111 --- /dev/null +++ b/testsuite/tests/driver/boot5688/all.T @@ -0,0 +1,3 @@ +test('boot5688', [extra_files(['A.hs', 'B.hs', 'B.hs-boot', 'C.hs', 'D.hs', 'E.hs']), + when(fast(), skip)], + makefile_test, []) diff --git a/testsuite/tests/driver/boot5688/boot5688.stdout b/testsuite/tests/driver/boot5688/boot5688.stdout new file mode 100644 index 0000000000..96311b5787 --- /dev/null +++ b/testsuite/tests/driver/boot5688/boot5688.stdout @@ -0,0 +1,6 @@ +[1 of 6] Compiling B[boot] ( B.hs-boot, nothing ) +[2 of 6] Compiling D ( D.hs, nothing ) +[3 of 6] Compiling B ( B.hs, nothing ) +[4 of 6] Compiling C ( C.hs, nothing ) +[5 of 6] Compiling E ( E.hs, nothing ) +[6 of 6] Compiling A ( A.hs, nothing ) diff --git a/testsuite/tests/driver/json2.stderr b/testsuite/tests/driver/json2.stderr index 17d072363d..71d7f5edfa 100644 --- a/testsuite/tests/driver/json2.stderr +++ b/testsuite/tests/driver/json2.stderr @@ -1 +1 @@ -{"span": null,"doc": "TYPE SIGNATURES\n foo :: forall a. a -> a\nDependent modules: []\nDependent packages: [base-4.13.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]","messageClass": "MCOutput"} +{"span": null,"doc": "TYPE SIGNATURES\n foo :: forall a. a -> a\nDependent modules: []\nDependent packages: [base-4.16.0.0]","messageClass": "MCOutput"} diff --git a/testsuite/tests/driver/recomp-boot/A.hs b/testsuite/tests/driver/recomp-boot/A.hs new file mode 100644 index 0000000000..41644a1c54 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/A.hs @@ -0,0 +1,3 @@ +module A where + +import B diff --git a/testsuite/tests/driver/recomp-boot/B1.hs b/testsuite/tests/driver/recomp-boot/B1.hs new file mode 100644 index 0000000000..ca48559b6d --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/B1.hs @@ -0,0 +1,3 @@ +module B where + +import C diff --git a/testsuite/tests/driver/recomp-boot/B2.hs b/testsuite/tests/driver/recomp-boot/B2.hs new file mode 100644 index 0000000000..29b41f12fe --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/B2.hs @@ -0,0 +1,3 @@ +module B where + +import {-# SOURCE #-} C diff --git a/testsuite/tests/driver/recomp-boot/C.hs b/testsuite/tests/driver/recomp-boot/C.hs new file mode 100644 index 0000000000..5831959653 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/C.hs @@ -0,0 +1 @@ +module C where diff --git a/testsuite/tests/driver/recomp-boot/C.hs-boot b/testsuite/tests/driver/recomp-boot/C.hs-boot new file mode 100644 index 0000000000..5831959653 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/C.hs-boot @@ -0,0 +1 @@ +module C where diff --git a/testsuite/tests/driver/recomp-boot/Makefile b/testsuite/tests/driver/recomp-boot/Makefile new file mode 100644 index 0000000000..e888238170 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/Makefile @@ -0,0 +1,20 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Recompilation tests + +clean: + rm -f *.o *.hi + rm -f B.hs + +# Recompile + +recomp-boot: clean + cp B1.hs B.hs + '$(TEST_HC)' $(TEST_HC_OPTS) --make A.hs + sleep 1 + cp B2.hs B.hs + # Operating systems with poor timer resolution (e.g. Darwin) need a bit + # of time here, lest GHC not realize that the file changed. + '$(TEST_HC)' $(TEST_HC_OPTS) --make A.hs diff --git a/testsuite/tests/driver/recomp-boot/all.T b/testsuite/tests/driver/recomp-boot/all.T new file mode 100644 index 0000000000..ca3ab09047 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/all.T @@ -0,0 +1,3 @@ +test('recomp-boot', [extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs', 'C.hs-boot']), + when(fast(), skip)], + makefile_test, []) diff --git a/testsuite/tests/driver/recomp-boot/recomp-boot.stdout b/testsuite/tests/driver/recomp-boot/recomp-boot.stdout new file mode 100644 index 0000000000..77f5a1794a --- /dev/null +++ b/testsuite/tests/driver/recomp-boot/recomp-boot.stdout @@ -0,0 +1,6 @@ +[1 of 3] Compiling C ( C.hs, C.o ) +[2 of 3] Compiling B ( B.hs, B.o ) +[3 of 3] Compiling A ( A.hs, A.o ) +[1 of 4] Compiling C[boot] ( C.hs-boot, C.o-boot ) +[3 of 4] Compiling B ( B.hs, B.o ) +[4 of 4] Compiling A ( A.hs, A.o ) [B changed] diff --git a/testsuite/tests/driver/recomp-boot2/A.hs b/testsuite/tests/driver/recomp-boot2/A.hs new file mode 100644 index 0000000000..41644a1c54 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/A.hs @@ -0,0 +1,3 @@ +module A where + +import B diff --git a/testsuite/tests/driver/recomp-boot2/B1.hs b/testsuite/tests/driver/recomp-boot2/B1.hs new file mode 100644 index 0000000000..ca48559b6d --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/B1.hs @@ -0,0 +1,3 @@ +module B where + +import C diff --git a/testsuite/tests/driver/recomp-boot2/B2.hs b/testsuite/tests/driver/recomp-boot2/B2.hs new file mode 100644 index 0000000000..29b41f12fe --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/B2.hs @@ -0,0 +1,3 @@ +module B where + +import {-# SOURCE #-} C diff --git a/testsuite/tests/driver/recomp-boot2/C.hs b/testsuite/tests/driver/recomp-boot2/C.hs new file mode 100644 index 0000000000..5831959653 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/C.hs @@ -0,0 +1 @@ +module C where diff --git a/testsuite/tests/driver/recomp-boot2/C.hs-boot b/testsuite/tests/driver/recomp-boot2/C.hs-boot new file mode 100644 index 0000000000..5831959653 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/C.hs-boot @@ -0,0 +1 @@ +module C where diff --git a/testsuite/tests/driver/recomp-boot2/M.hs b/testsuite/tests/driver/recomp-boot2/M.hs new file mode 100644 index 0000000000..34172494e2 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/M.hs @@ -0,0 +1,4 @@ +module M where + +import A +import C diff --git a/testsuite/tests/driver/recomp-boot2/Makefile b/testsuite/tests/driver/recomp-boot2/Makefile new file mode 100644 index 0000000000..8af96fafe7 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/Makefile @@ -0,0 +1,21 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Recompilation tests + +clean: + rm -f *.o *.hi + rm -f B.hs + +# Recompile, adding the extra boot dependency should also cause Top to be recompiled +# even though we don't use the boot file. + +recomp-boot2: clean + cp B1.hs B.hs + '$(TEST_HC)' $(TEST_HC_OPTS) --make Top.hs + sleep 1 + cp B2.hs B.hs + # Operating systems with poor timer resolution (e.g. Darwin) need a bit + # of time here, lest GHC not realize that the file changed. + '$(TEST_HC)' $(TEST_HC_OPTS) --make Top.hs diff --git a/testsuite/tests/driver/recomp-boot2/Top.hs b/testsuite/tests/driver/recomp-boot2/Top.hs new file mode 100644 index 0000000000..ead43b5317 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/Top.hs @@ -0,0 +1,3 @@ +module Top where + +import M diff --git a/testsuite/tests/driver/recomp-boot2/all.T b/testsuite/tests/driver/recomp-boot2/all.T new file mode 100644 index 0000000000..ea33c7ba48 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/all.T @@ -0,0 +1,3 @@ +test('recomp-boot2', [extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs', 'C.hs-boot', 'Top.hs', 'M.hs']), + when(fast(), skip)], + makefile_test, []) diff --git a/testsuite/tests/driver/recomp-boot2/recomp-boot.stdout b/testsuite/tests/driver/recomp-boot2/recomp-boot.stdout new file mode 100644 index 0000000000..77f5a1794a --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/recomp-boot.stdout @@ -0,0 +1,6 @@ +[1 of 3] Compiling C ( C.hs, C.o ) +[2 of 3] Compiling B ( B.hs, B.o ) +[3 of 3] Compiling A ( A.hs, A.o ) +[1 of 4] Compiling C[boot] ( C.hs-boot, C.o-boot ) +[3 of 4] Compiling B ( B.hs, B.o ) +[4 of 4] Compiling A ( A.hs, A.o ) [B changed] diff --git a/testsuite/tests/driver/recomp-boot2/recomp-boot2.stdout b/testsuite/tests/driver/recomp-boot2/recomp-boot2.stdout new file mode 100644 index 0000000000..aec38b5f06 --- /dev/null +++ b/testsuite/tests/driver/recomp-boot2/recomp-boot2.stdout @@ -0,0 +1,10 @@ +[1 of 5] Compiling C ( C.hs, C.o ) +[2 of 5] Compiling B ( B.hs, B.o ) +[3 of 5] Compiling A ( A.hs, A.o ) +[4 of 5] Compiling M ( M.hs, M.o ) +[5 of 5] Compiling Top ( Top.hs, Top.o ) +[1 of 6] Compiling C[boot] ( C.hs-boot, C.o-boot ) +[3 of 6] Compiling B ( B.hs, B.o ) +[4 of 6] Compiling A ( A.hs, A.o ) [B changed] +[5 of 6] Compiling M ( M.hs, M.o ) [A changed] +[6 of 6] Compiling Top ( Top.hs, Top.o ) [M changed] diff --git a/testsuite/tests/driver/recomp007/Makefile b/testsuite/tests/driver/recomp007/Makefile index 0ced239efe..caf746ed84 100644 --- a/testsuite/tests/driver/recomp007/Makefile +++ b/testsuite/tests/driver/recomp007/Makefile @@ -17,10 +17,12 @@ recomp007: "$(TEST_HC)" -v0 --make Setup.hs $(MAKE) -s --no-print-directory prep.a1 $(MAKE) -s --no-print-directory prep.b + ./b/dist/build/test/test "$(GHC_PKG)" unregister --package-db=$(LOCAL_PKGCONF) a-1.0 $(MAKE) -s --no-print-directory prep.a2 cd b && ../Setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF) cd b && ../Setup build + ./b/dist/build/test/test prep.%: cd $* && ../Setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF) diff --git a/testsuite/tests/driver/recomp007/recomp007.stdout b/testsuite/tests/driver/recomp007/recomp007.stdout index d8343152e0..51b9a2a30c 100644 --- a/testsuite/tests/driver/recomp007/recomp007.stdout +++ b/testsuite/tests/driver/recomp007/recomp007.stdout @@ -1,5 +1,6 @@ +"1.0" Preprocessing executable 'test' for b-1.0.. Building executable 'test' for b-1.0.. [1 of 2] Compiling B ( B.hs, dist/build/test/test-tmp/B.o ) [A changed] -[2 of 2] Compiling Main ( Main.hs, dist/build/test/test-tmp/Main.o ) [B changed] Linking dist/build/test/test ... +"2.0" |