[commit: testsuite] master: Recompilation test case for #8247 (b1f6cab)

git at git.haskell.org git at git.haskell.org
Tue Sep 17 22:38:32 CEST 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b1f6cab360faf79d586eda8ee3c1c486e53d0066/testsuite

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

commit b1f6cab360faf79d586eda8ee3c1c486e53d0066
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Sep 17 22:37:51 2013 +0200

    Recompilation test case for #8247
    
    But seems to be fixed in head already.


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

b1f6cab360faf79d586eda8ee3c1c486e53d0066
 tests/{rts/T5423.stdout => driver/recomp013/A.hs} |    3 +--
 tests/driver/recomp013/B.hs                       |    1 +
 tests/driver/recomp013/C.hs                       |    1 +
 tests/driver/recomp013/Makefile                   |   24 +++++++++++++++++++++
 tests/driver/recomp013/all.T                      |    7 ++++++
 tests/driver/recomp013/recomp013.stdout           |    7 ++++++
 6 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/tests/rts/T5423.stdout b/tests/driver/recomp013/A.hs
similarity index 77%
copy from tests/rts/T5423.stdout
copy to tests/driver/recomp013/A.hs
index 478bb27..01599b3 100644
--- a/tests/rts/T5423.stdout
+++ b/tests/driver/recomp013/A.hs
@@ -1,2 +1 @@
-120
-111  112  113  114  115  116  117  118  119  120
+module A where a1 = 5; a2 = 42; a3 = 113
diff --git a/tests/driver/recomp013/B.hs b/tests/driver/recomp013/B.hs
new file mode 100644
index 0000000..5737299
--- /dev/null
+++ b/tests/driver/recomp013/B.hs
@@ -0,0 +1 @@
+module B (module A) where import A hiding (a1, a2)
diff --git a/tests/driver/recomp013/C.hs b/tests/driver/recomp013/C.hs
new file mode 100644
index 0000000..da2c02f
--- /dev/null
+++ b/tests/driver/recomp013/C.hs
@@ -0,0 +1 @@
+module C where import B; a2 = 142
diff --git a/tests/driver/recomp013/Makefile b/tests/driver/recomp013/Makefile
new file mode 100644
index 0000000..1b213c4
--- /dev/null
+++ b/tests/driver/recomp013/Makefile
@@ -0,0 +1,24 @@
+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
+
+# bug #8247
+
+recomp013: clean
+	echo 'module A where a1 = 5; a2 = 42; a3 = 113' > A.hs
+	echo 'module B (module A) where import A hiding (a1)' > B.hs
+	echo 'module C where import B; a2 = 142' > C.hs
+	echo 'first run'
+	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make C.hs
+	echo 'module B (module A) where import A hiding (a1, a2)' > B.hs
+	echo 'second run'
+	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make C.hs
diff --git a/tests/driver/recomp013/all.T b/tests/driver/recomp013/all.T
new file mode 100644
index 0000000..a40255a
--- /dev/null
+++ b/tests/driver/recomp013/all.T
@@ -0,0 +1,7 @@
+# Test for #8247, a recompilation bug
+
+test('recomp013',
+     [ clean_cmd('$MAKE -s clean') ],
+     run_command,
+     ['$MAKE -s --no-print-directory recomp013'])
+
diff --git a/tests/driver/recomp013/recomp013.stdout b/tests/driver/recomp013/recomp013.stdout
new file mode 100644
index 0000000..0a5aef7
--- /dev/null
+++ b/tests/driver/recomp013/recomp013.stdout
@@ -0,0 +1,7 @@
+first run
+[1 of 3] Compiling A                ( A.hs, A.o )
+[2 of 3] Compiling B                ( B.hs, B.o )
+[3 of 3] Compiling C                ( C.hs, C.o )
+second run
+[2 of 3] Compiling B                ( B.hs, B.o )
+[3 of 3] Compiling C                ( C.hs, C.o ) [B changed]




More information about the ghc-commits mailing list