summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2015-09-02 15:58:38 -0700
committerJoachim Breitner <mail@joachim-breitner.de>2015-09-02 16:05:55 -0700
commit6066e1fa6770f2cae3114ab4d4dbde04176863cb (patch)
treebe939e47eea14de6b40e985f61b94c4aeb3afcda /testsuite/tests
parentbd16e0bc6af13f1347235782935f7dcd40b260e2 (diff)
downloadhaskell-wip/T10830.tar.gz
Make Data.List.foldr1 inlinewip/T10830
Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/simplCore/should_run/T10830.hs3
-rw-r--r--testsuite/tests/simplCore/should_run/all.T1
2 files changed, 4 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T10830.hs b/testsuite/tests/simplCore/should_run/T10830.hs
new file mode 100644
index 0000000000..354f0f513a
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T10830.hs
@@ -0,0 +1,3 @@
+import GHC.OldList
+main :: IO ()
+main = maximumBy compare [1..10000] `seq` return ()
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index 364dfd694f..ba775b7228 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -69,3 +69,4 @@ test('T457', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run,
test('T9128', normal, compile_and_run, [''])
test('T9390', normal, compile_and_run, [''])
+test('T10830', extra_run_opts('+RTS -K100k -RTS'), compile_and_run, [''])