Ticket #7246: 0001-Test-case-for-call-stack-with-a-recursive-call.patch

File 0001-Test-case-for-call-stack-with-a-recursive-call.patch, 3.5 KB (added by nomeata, 19 months ago)
  • tests/profiling/should_run/all.T

    From e757d2275ecb2253f38a419f7a8461208007da9a Mon Sep 17 00:00:00 2001
    From: Joachim Breitner <mail@joachim-breitner.de>
    Date: Mon, 17 Sep 2012 12:23:16 +0200
    Subject: [PATCH] Test case for call stack with a recursive call
    
    Result currently varies between ways (prof, profasm, profthreaded);
    this is reported as #7246.
    ---
     tests/profiling/should_run/all.T               |    4 ++++
     tests/profiling/should_run/callstack003.hs     |   12 ++++++++++++
     tests/profiling/should_run/callstack003.stdout |    8 ++++++++
     3 files changed, 24 insertions(+)
     create mode 100644 tests/profiling/should_run/callstack003.hs
     create mode 100644 tests/profiling/should_run/callstack003.stdout
    
    diff --git a/tests/profiling/should_run/all.T b/tests/profiling/should_run/all.T
    index 539e0e7..c5172dc 100644
    a b test('callstack002', 
    108108     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], 
    109109     compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack']) 
    110110 
     111test('callstack003', 
     112     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], 
     113     compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack']) 
     114 
    111115# Should not stack overflow with -prof -auto-all 
    112116test('T5363', 
    113117     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], 
  • new file tests/profiling/should_run/callstack003.hs

    diff --git a/tests/profiling/should_run/callstack003.hs b/tests/profiling/should_run/callstack003.hs
    new file mode 100644
    index 0000000..f6be4ca
    - +  
     1module Main where 
     2 
     3import GHC.Stack 
     4import Prelude hiding (mapM) 
     5 
     6f :: () -> IO () 
     7f () = do currentCallStack >>= print 
     8 
     9main = doTwice go1 () 
     10doTwice f x = f x >> f x 
     11go1 x = doTwice go2 x 
     12go2 x = doTwice f x 
  • new file tests/profiling/should_run/callstack003.stdout

    diff --git a/tests/profiling/should_run/callstack003.stdout b/tests/profiling/should_run/callstack003.stdout
    new file mode 100644
    index 0000000..271dd9a
    - +  
     1["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:15-17)","Main.f (callstack003.hs:7:11-36)"] 
     2["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:22-24)","Main.f (callstack003.hs:7:11-36)"] 
     3["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:15-17)","Main.f (callstack003.hs:7:11-36)"] 
     4["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:22-24)","Main.f (callstack003.hs:7:11-36)"] 
     5["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:15-17)","Main.f (callstack003.hs:7:11-36)"] 
     6["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:22-24)","Main.f (callstack003.hs:7:11-36)"] 
     7["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:15-17)","Main.f (callstack003.hs:7:11-36)"] 
     8["Main.CAF (<entire-module>)","Main.main (callstack003.hs:9:8-21)","Main.doTwice (callstack003.hs:10:15-24)","Main.doTwice (callstack003.hs:10:22-24)","Main.f (callstack003.hs:7:11-36)"]