diff --git a/testsuite/tests/profiling/should_run/T5363.hs b/testsuite/tests/profiling/should_run/T5363.hs new file mode 100644 index 0000000000000000000000000000000000000000..5167bbe6e0acacb6241e6ed012d753bfd88219c3 --- /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 0000000000000000000000000000000000000000..a10b91560be7afc77351773e42160d1f4bdc4726 --- /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 154d3829b8c842a7cbe570ba763fe0fa879b7b08..0298c42141bcad9979dbf397dd6cabeebccb6621 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, ['']) +