diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-29 18:45:49 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-01 18:34:53 -0400 |
commit | 0bb02873eeeca41a64d26becb9057e988f444acd (patch) | |
tree | 81c399ef41f50fd2cde306c69f364b9803d34fef | |
parent | 5c32655fffd0d8862f3ba693351f1e612daa0b6b (diff) | |
download | haskell-0bb02873eeeca41a64d26becb9057e988f444acd.tar.gz |
Add test for T18574
-rw-r--r-- | testsuite/tests/perf/should_run/T18574.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/perf/should_run/T18574.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/perf/should_run/all.T | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/perf/should_run/T18574.hs b/testsuite/tests/perf/should_run/T18574.hs new file mode 100644 index 0000000000..4e0971b67d --- /dev/null +++ b/testsuite/tests/perf/should_run/T18574.hs @@ -0,0 +1,7 @@ +import Data.Maybe + +main :: IO () +main = print $ even $ sum $ catMaybes $ map xx ([1..100000000] :: [Int]) + where + xx n | even n = Just n + | otherwise = Nothing diff --git a/testsuite/tests/perf/should_run/T18574.stdout b/testsuite/tests/perf/should_run/T18574.stdout new file mode 100644 index 0000000000..0ca95142bb --- /dev/null +++ b/testsuite/tests/perf/should_run/T18574.stdout @@ -0,0 +1 @@ +True diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 2ad3a1a546..17385d9c83 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -379,3 +379,9 @@ test('UniqLoop', ], compile_and_run, ['-O -package ghc']) + +test('T18574', + [collect_stats('bytes allocated', 5), only_ways(['normal'])], + compile_and_run, + ['-O']) + |