Add a testcase for #13227
authorJoachim Breitner <mail@joachim-breitner.de>
Thu, 2 Feb 2017 17:04:43 +0000 (12:04 -0500)
committerJoachim Breitner <mail@joachim-breitner.de>
Thu, 2 Feb 2017 17:04:43 +0000 (12:04 -0500)
where an expected float-out is not happening.

testsuite/tests/simplCore/should_run/T13227.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_run/T13227.stderr [new file with mode: 0644]
testsuite/tests/simplCore/should_run/all.T

diff --git a/testsuite/tests/simplCore/should_run/T13227.hs b/testsuite/tests/simplCore/should_run/T13227.hs
new file mode 100644 (file)
index 0000000..7bf1b84
--- /dev/null
@@ -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 (file)
index 0000000..9b9ef72
--- /dev/null
@@ -0,0 +1 @@
+Evaluate me only once!
index 68bd12c..6fe17e1 100644 (file)
@@ -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, [''])