diff options
Diffstat (limited to 'testsuite/tests/driver/recomp003')
-rw-r--r-- | testsuite/tests/driver/recomp003/A.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/recomp003/Makefile | 18 | ||||
-rw-r--r-- | testsuite/tests/driver/recomp003/all.T | 6 |
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/driver/recomp003/A.hs b/testsuite/tests/driver/recomp003/A.hs new file mode 100644 index 0000000000..7fa4516161 --- /dev/null +++ b/testsuite/tests/driver/recomp003/A.hs @@ -0,0 +1,3 @@ +module A where +import Data.Char + diff --git a/testsuite/tests/driver/recomp003/Makefile b/testsuite/tests/driver/recomp003/Makefile new file mode 100644 index 0000000000..7f6bfc2e48 --- /dev/null +++ b/testsuite/tests/driver/recomp003/Makefile @@ -0,0 +1,18 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +OBJSUFFIX = .o + +# Test that adding a new module that shadows a package module causes +# recompilation. Part of bug #1372. +recomp003: + $(RM) A.hi A$(OBJSUFFIX) out + $(RM) -rf Data + mkdir Data + '$(TEST_HC)' $(TEST_HC_OPTS) -c A.hs + echo "module Data.Char where" > Data/Char.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -c Data/Char.hs + # Should now recompile A.hs, because Char is now a home module: + '$(TEST_HC)' $(TEST_HC_OPTS) -c A.hs 2>err + @if grep NOT err; then false; fi diff --git a/testsuite/tests/driver/recomp003/all.T b/testsuite/tests/driver/recomp003/all.T new file mode 100644 index 0000000000..c6653c2723 --- /dev/null +++ b/testsuite/tests/driver/recomp003/all.T @@ -0,0 +1,6 @@ +test('recomp003', + extra_clean(['Data/Char.hs', 'Data/Char.hi', 'Data/Char.o', + 'A.o', 'A.hi', + 'err']), + run_command, + ['$MAKE -s --no-print-directory recomp003']) |