diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-12-27 10:50:01 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-01-03 11:56:14 -0800 |
commit | 2223e196b2dc5340d70e58be011c279d381b4319 (patch) | |
tree | 3c587547990df7c62d73598f9dfe991afb0b4880 /testsuite/tests/driver/retc002 | |
parent | af4d99803ea7676f88f250ad56a8c31c1c8cd5bc (diff) | |
download | haskell-2223e196b2dc5340d70e58be011c279d381b4319.tar.gz |
Fix #9243 so recompilation avoidance works with -fno-code
Summary:
Where we track timestamps of object files, also track timestamps
for interface files. When -fno-code -fwrite-interface is enabled, use
the interface file timestamp as an extra check to see if the files are
up-to-date. We had to apply this logic to one-shot and make modes.
This fix would be good to merge into 7.10; it makes using -fno-code
-fwrite-interface for flywheel type checking usable.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate and new test cases
Reviewers: austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D596
GHC Trac Issues: #9243
Diffstat (limited to 'testsuite/tests/driver/retc002')
-rw-r--r-- | testsuite/tests/driver/retc002/Makefile | 20 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/Q.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/W.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/W.hs-boot | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/all.T | 6 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/retc002.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/retc002/retc002.stdout | 3 |
7 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/tests/driver/retc002/Makefile b/testsuite/tests/driver/retc002/Makefile new file mode 100644 index 0000000000..528df4b471 --- /dev/null +++ b/testsuite/tests/driver/retc002/Makefile @@ -0,0 +1,20 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# -fforce-recomp makes lots of driver tests trivially pass, so we +# filter it out from $(TEST_HC_OPTS). +TEST_HC_OPTS_NO_RECOMP = $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) + +# Recompilation tests + +clean: + rm -f *.o* + rm -f *.hi* + +# Only the first invocation should print any "Compiling" messages + +retc002: clean + '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -fwrite-interface -fno-code --make Q.hs + echo Middle >&2 + '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -fwrite-interface -fno-code --make Q.hs diff --git a/testsuite/tests/driver/retc002/Q.hs b/testsuite/tests/driver/retc002/Q.hs new file mode 100644 index 0000000000..3565f02de4 --- /dev/null +++ b/testsuite/tests/driver/retc002/Q.hs @@ -0,0 +1,3 @@ +module Q where + +import {-# SOURCE #-} W diff --git a/testsuite/tests/driver/retc002/W.hs b/testsuite/tests/driver/retc002/W.hs new file mode 100644 index 0000000000..3dd7ff92c8 --- /dev/null +++ b/testsuite/tests/driver/retc002/W.hs @@ -0,0 +1,3 @@ +module W where + +import Q diff --git a/testsuite/tests/driver/retc002/W.hs-boot b/testsuite/tests/driver/retc002/W.hs-boot new file mode 100644 index 0000000000..4992c51af8 --- /dev/null +++ b/testsuite/tests/driver/retc002/W.hs-boot @@ -0,0 +1 @@ +module W where diff --git a/testsuite/tests/driver/retc002/all.T b/testsuite/tests/driver/retc002/all.T new file mode 100644 index 0000000000..47794fbe39 --- /dev/null +++ b/testsuite/tests/driver/retc002/all.T @@ -0,0 +1,6 @@ +test('retc002', + [when(fast(), skip), + clean_cmd('$MAKE -s clean')], + run_command, + ['$MAKE -s --no-print-directory retc002']) + diff --git a/testsuite/tests/driver/retc002/retc002.stderr b/testsuite/tests/driver/retc002/retc002.stderr new file mode 100644 index 0000000000..56cdd85e1d --- /dev/null +++ b/testsuite/tests/driver/retc002/retc002.stderr @@ -0,0 +1 @@ +Middle diff --git a/testsuite/tests/driver/retc002/retc002.stdout b/testsuite/tests/driver/retc002/retc002.stdout new file mode 100644 index 0000000000..e76853f8f8 --- /dev/null +++ b/testsuite/tests/driver/retc002/retc002.stdout @@ -0,0 +1,3 @@ +[1 of 3] Compiling W[boot] ( W.hs-boot, nothing ) +[2 of 3] Compiling Q ( Q.hs, nothing ) +[3 of 3] Compiling W ( W.hs, nothing ) |