Commit f713be7a authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

RtsFlags: allow +RTS -K0

Reviewers: erikd, simonmar, hvr

Reviewed By: hvr

Subscribers: hvr, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4238
parent b241d6db
......@@ -1015,7 +1015,7 @@ error = true;
case 'K':
OPTION_UNSAFE;
RtsFlags.GcFlags.maxStkSize =
decodeSize(rts_argv[arg], 2, sizeof(W_), HS_WORD_MAX)
decodeSize(rts_argv[arg], 2, 0, HS_WORD_MAX)
/ sizeof(W_);
break;
......
......@@ -97,6 +97,9 @@ test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
compile_and_run, [''])
# Test that +RTS -K0 (e.g. no stack limit) parses correctly
test('stack004', [extra_run_opts('+RTS -K0 -RTS') ], compile_and_run, [''])
test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], compile_and_run, [''])
test('atomicxchg', [ c_src, only_ways(['threaded1', 'threaded2']) ],
compile_and_run, [''])
......
module Main where
import Control.Monad
import GHC.RTS.Flags
-- Ensure that +RTS -K0 is parsed
main :: IO ()
main = do
flags <- getGCFlags
unless (maxStkSize flags == 0) $ putStrLn "uh oh"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment