[commit: ghc] wip/8144: Add test case for #8144. (a3bf4bf)

git at git.haskell.org git at git.haskell.org
Sat Nov 22 00:43:43 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/8144
Link       : http://ghc.haskell.org/trac/ghc/changeset/a3bf4bfae694572b0bf886fcb1191d066d242aed/ghc

>---------------------------------------------------------------

commit a3bf4bfae694572b0bf886fcb1191d066d242aed
Author: Niklas Hambüchen <mail at nh2.me>
Date:   Tue Nov 18 21:10:45 2014 -0600

    Add test case for #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 at well-typed.com>


>---------------------------------------------------------------

a3bf4bfae694572b0bf886fcb1191d066d242aed
 testsuite/tests/driver/recomp015/Makefile          | 32 ++++++++++++++++++++++
 testsuite/tests/driver/recomp015/Test.hs           |  3 ++
 testsuite/tests/driver/recomp015/all.T             |  7 +++++
 .../tests/driver/recomp015/cabal_macros.h          |  0
 testsuite/tests/driver/recomp015/recomp015.stdout  |  5 ++++
 5 files changed, 47 insertions(+)

diff --git a/testsuite/tests/driver/recomp015/Makefile b/testsuite/tests/driver/recomp015/Makefile
new file mode 100644
index 0000000..430516d
--- /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 0000000..5c8df53
--- /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 0000000..0643030
--- /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/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/driver/recomp015/cabal_macros.h
similarity index 100%
copy from libraries/base/tests/IO/misc001.stdout
copy to 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 0000000..178cb00
--- /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



More information about the ghc-commits mailing list