[commit: ghc] master: Add a testcase for #13227 (d8ac64e)
git at git.haskell.org
git at git.haskell.org
Thu Feb 2 17:05:38 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d8ac64e782b8543e5a525c7bb738620bd09aa398/ghc
>---------------------------------------------------------------
commit d8ac64e782b8543e5a525c7bb738620bd09aa398
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Thu Feb 2 12:04:43 2017 -0500
Add a testcase for #13227
where an expected float-out is not happening.
>---------------------------------------------------------------
d8ac64e782b8543e5a525c7bb738620bd09aa398
testsuite/tests/simplCore/should_run/T13227.hs | 10 ++++++++++
testsuite/tests/simplCore/should_run/T13227.stderr | 1 +
testsuite/tests/simplCore/should_run/all.T | 1 +
3 files changed, 12 insertions(+)
diff --git a/testsuite/tests/simplCore/should_run/T13227.hs b/testsuite/tests/simplCore/should_run/T13227.hs
new file mode 100644
index 0000000..7bf1b84
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T13227.hs
@@ -0,0 +1,10 @@
+import Debug.Trace
+
+g x expensive ys = let h = \y -> y + expensive x
+ in map h ys
+{-# NOINLINE g #-}
+
+foo x = trace "Evaluate me only once!" x
+
+main = sum (g 1 foo [1,2,3]) `seq` return ()
+
diff --git a/testsuite/tests/simplCore/should_run/T13227.stderr b/testsuite/tests/simplCore/should_run/T13227.stderr
new file mode 100644
index 0000000..9b9ef72
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T13227.stderr
@@ -0,0 +1 @@
+Evaluate me only once!
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index 68bd12c..6fe17e1 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -73,3 +73,4 @@ test('T12689broken', expect_broken(12689), compile_and_run, [''])
test('T12689a', normal, compile_and_run, [''])
test('T13172', only_ways(['optasm']), compile_and_run, ['-dcore-lint'])
+test('T13227', expect_broken(13227), compile_and_run, [''])
More information about the ghc-commits
mailing list