diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-07-28 18:25:35 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-28 18:25:37 -0400 |
commit | 84f8e86248d47f619a94c68260876a1258e0a931 (patch) | |
tree | 3756862bea5f88211423346c0c058dcf196950b8 /testsuite | |
parent | d75bba852db208b1d9fcb84dab01598a765d2534 (diff) | |
download | haskell-84f8e86248d47f619a94c68260876a1258e0a931.tar.gz |
Ensure that GHC.Stack.callStack doesn't fail
Test Plan: Validate, ensure the `f7` program of `IPLocation` doesn't
crash.
Reviewers: gridaphobe, austin, hvr
Reviewed By: gridaphobe
Subscribers: rwbarton, thomie
GHC Trac Issues: #14028
Differential Revision: https://phabricator.haskell.org/D3795
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_run/IPLocation.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/IPLocation.hs b/testsuite/tests/typecheck/should_run/IPLocation.hs index 75575e0d16..964728934e 100644 --- a/testsuite/tests/typecheck/should_run/IPLocation.hs +++ b/testsuite/tests/typecheck/should_run/IPLocation.hs @@ -29,9 +29,15 @@ f6 0 = putStrLn $ prettyCallStack ?loc f6 n = f6 (n-1) -- recursive functions add a SrcLoc for each recursive call +f7 :: IO () +f7 = putStrLn (prettyCallStack $ id (\_ -> callStack) ()) + -- shouldn't crash. See #14043. + +main :: IO () main = do f0 f1 f3 (\ () -> putStrLn $ prettyCallStack ?loc) f4 (\ () -> putStrLn $ prettyCallStack ?loc) f5 (\ () -> putStrLn $ prettyCallStack ?loc3) f6 5 + f7 |