summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2017-02-02 12:04:43 -0500
committerJoachim Breitner <mail@joachim-breitner.de>2017-02-02 12:04:43 -0500
commitd8ac64e782b8543e5a525c7bb738620bd09aa398 (patch)
treefb9dcd87bcb81e7e63d9f59201eed915545433b9 /testsuite/tests/simplCore/should_run
parent8dd82ead7ddd65348bcbea4e2bb8defce4253173 (diff)
downloadhaskell-d8ac64e782b8543e5a525c7bb738620bd09aa398.tar.gz
Add a testcase for #13227
where an expected float-out is not happening.
Diffstat (limited to 'testsuite/tests/simplCore/should_run')
-rw-r--r--testsuite/tests/simplCore/should_run/T13227.hs10
-rw-r--r--testsuite/tests/simplCore/should_run/T13227.stderr1
-rw-r--r--testsuite/tests/simplCore/should_run/all.T1
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T13227.hs b/testsuite/tests/simplCore/should_run/T13227.hs
new file mode 100644
index 0000000000..7bf1b840fa
--- /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 0000000000..9b9ef72cc0
--- /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 68bd12caff..6fe17e17d6 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, [''])