summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2014-11-18 21:10:45 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-21 18:44:14 -0600
commita3bf4bfae694572b0bf886fcb1191d066d242aed (patch)
tree60fb4f7111cd10d5354d8abd20e5bad5fd8dcf2b
parentef5bcc16c600f78fb23662c98da2469b4751a6e9 (diff)
downloadhaskell-wip/8144.tar.gz
Add test case for #8144.wip/8144
Based on: https://github.com/nh2/ghc-bug-time-dependent-interface-hashes I verified that this test fails for GHC 7.6.3 and older, and passes for GHC 7.8 and newer. Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r--testsuite/tests/driver/recomp015/Makefile32
-rw-r--r--testsuite/tests/driver/recomp015/Test.hs3
-rw-r--r--testsuite/tests/driver/recomp015/all.T7
-rw-r--r--testsuite/tests/driver/recomp015/cabal_macros.h0
-rw-r--r--testsuite/tests/driver/recomp015/recomp015.stdout5
5 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/tests/driver/recomp015/Makefile b/testsuite/tests/driver/recomp015/Makefile
new file mode 100644
index 0000000000..430516d001
--- /dev/null
+++ b/testsuite/tests/driver/recomp015/Makefile
@@ -0,0 +1,32 @@
+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 *.hi
+ rm -f Test$(exeext)
+
+# bug #8144
+
+# All compilations except the first should print
+# compilation IS NOT required
+
+recomp015: clean
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
+ touch cabal_macros.h
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
+ touch cabal_macros.h
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
+ touch cabal_macros.h
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
+ touch cabal_macros.h
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
+ touch cabal_macros.h
+ sleep 2
+ ghc -c Test.hs -optP-include -optPcabal_macros.h
diff --git a/testsuite/tests/driver/recomp015/Test.hs b/testsuite/tests/driver/recomp015/Test.hs
new file mode 100644
index 0000000000..5c8df5383c
--- /dev/null
+++ b/testsuite/tests/driver/recomp015/Test.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE CPP #-}
+
+module Test () where
diff --git a/testsuite/tests/driver/recomp015/all.T b/testsuite/tests/driver/recomp015/all.T
new file mode 100644
index 0000000000..06430307fd
--- /dev/null
+++ b/testsuite/tests/driver/recomp015/all.T
@@ -0,0 +1,7 @@
+# Test for #8144, a recompilation bug
+
+test('recomp015',
+ [ clean_cmd('$MAKE -s clean') ],
+ run_command,
+ ['$MAKE -s --no-print-directory recomp015'])
+
diff --git a/testsuite/tests/driver/recomp015/cabal_macros.h b/testsuite/tests/driver/recomp015/cabal_macros.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/tests/driver/recomp015/cabal_macros.h
diff --git a/testsuite/tests/driver/recomp015/recomp015.stdout b/testsuite/tests/driver/recomp015/recomp015.stdout
new file mode 100644
index 0000000000..178cb00a26
--- /dev/null
+++ b/testsuite/tests/driver/recomp015/recomp015.stdout
@@ -0,0 +1,5 @@
+compilation IS NOT required
+compilation IS NOT required
+compilation IS NOT required
+compilation IS NOT required
+compilation IS NOT required