[commit: ghc] master: Refine test case for #9938 (9521a58)
git at git.haskell.org
git at git.haskell.org
Tue Dec 30 10:39:31 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/9521a58a5f3ca38a0bde8b67be00a74e5fc3ccea/ghc
>---------------------------------------------------------------
commit 9521a58a5f3ca38a0bde8b67be00a74e5fc3ccea
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Tue Dec 30 11:38:25 2014 +0100
Refine test case for #9938
By passing -O2, the bug appears depending on the order of clauses in
"solve", hence adding T9938B as the other variant.
Currently, T9938 is marked as broken, but maybe the bug is actually in
T9938B, where something (possibly inlining, as suggested by rwbarton)
affected the requirement to link against transformers.
>---------------------------------------------------------------
9521a58a5f3ca38a0bde8b67be00a74e5fc3ccea
testsuite/tests/driver/Makefile | 10 ++++++++--
testsuite/tests/driver/{T9938.hs => T9938B.hs} | 2 +-
testsuite/tests/driver/all.T | 5 +++++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile
index 2acedfc..3bec5b7 100644
--- a/testsuite/tests/driver/Makefile
+++ b/testsuite/tests/driver/Makefile
@@ -590,5 +590,11 @@ write_interface_make:
.PHONY: T9938
T9938:
$(RM) -rf T9938.o T9938.hi T9938
- "$(TEST_HC)" -c T9938.hs
- "$(TEST_HC)" T9938.o -o T9938
+ "$(TEST_HC)" $(TEST_HC_OPTS) -O2 -c T9938.hs
+ "$(TEST_HC)" $(TEST_HC_OPTS) -O2 T9938.o -o T9938
+
+.PHONY: T9938B
+T9938B:
+ $(RM) -rf T9938B.o T9938B.hi T9938B
+ "$(TEST_HC)" $(TEST_HC_OPTS) -O2 -c T9938B.hs
+ "$(TEST_HC)" $(TEST_HC_OPTS) -O2 T9938B.o -o T9938B
diff --git a/testsuite/tests/driver/T9938.hs b/testsuite/tests/driver/T9938B.hs
similarity index 100%
copy from testsuite/tests/driver/T9938.hs
copy to testsuite/tests/driver/T9938B.hs
index f9bb131..8b92369 100644
--- a/testsuite/tests/driver/T9938.hs
+++ b/testsuite/tests/driver/T9938B.hs
@@ -4,10 +4,10 @@ import Control.Monad
import Control.Monad.Trans.State
solve :: Int -> StateT () [] ()
+solve 0 = mzero
solve carry | carry > 0 =
do guard (0 == carry)
solve (carry -1)
-solve 0 = mzero
main :: IO ()
main = return ()
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index cd38ceb..fbacf2e 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -414,3 +414,8 @@ test('T9938',
[ extra_clean(['T9938.hi', 'T9938.o', 'T9938']), expect_broken(9938)],
run_command,
['$MAKE -s --no-print-directory T9938'])
+
+test('T9938B',
+ [ extra_clean(['T9938B.hi', 'T9938B.o', 'T9938B']) ],
+ run_command,
+ ['$MAKE -s --no-print-directory T9938B'])
More information about the ghc-commits
mailing list