diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-12-07 15:53:43 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-12-07 16:27:40 +0000 |
commit | 03ee7cd12f97a24907d1d3f8361c4c57b22a7e72 (patch) | |
tree | b9655850cdc30b35e949dbc2082fc447efe3f77f /testsuite/tests/profiling | |
parent | d559300086d1389aab522cd7067dc0fdbefdfa2b (diff) | |
download | haskell-03ee7cd12f97a24907d1d3f8361c4c57b22a7e72.tar.gz |
add test from #5363
Diffstat (limited to 'testsuite/tests/profiling')
-rw-r--r-- | testsuite/tests/profiling/should_run/T5363.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/profiling/should_run/T5363.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/profiling/should_run/all.T | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/profiling/should_run/T5363.hs b/testsuite/tests/profiling/should_run/T5363.hs new file mode 100644 index 0000000000..5167bbe6e0 --- /dev/null +++ b/testsuite/tests/profiling/should_run/T5363.hs @@ -0,0 +1,12 @@ +import Data.Array.Unboxed + +main = do + let l1 = [1..10] :: [Int] + let l2 = [ map (i+) l1 | i <- [1..500000] ] + let l3 = map (\l -> listArray (1,length l) l) l2 :: [UArray Int Int] + print $ accumulate l3 0 + +accumulate [] rv = rv +accumulate (h:t) rv = + let nextRv = (rv + sum (elems h)) in + accumulate t $! nextRv diff --git a/testsuite/tests/profiling/should_run/T5363.stdout b/testsuite/tests/profiling/should_run/T5363.stdout new file mode 100644 index 0000000000..a10b91560b --- /dev/null +++ b/testsuite/tests/profiling/should_run/T5363.stdout @@ -0,0 +1 @@ +1250030000000 diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 154d3829b8..0298c42141 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -107,3 +107,9 @@ test('callstack001', test('callstack002', [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack']) + +# Should not stack overflow with -prof -auto-all +test('T5363', + [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], + compile_and_run, ['']) + |