summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2023-04-19 10:39:44 +0100
committerGHC GitLab CI <ghc-ci@gitlab-haskell.org>2023-04-19 10:39:44 +0100
commit35fe9b6f845b5e0ef9370bc50ffc9b0a84a3a8db (patch)
tree2ffc1bce75c9d2aedc257fc9fd3b0fc77d4ea8a7
parent9956d777509b4457778d8cae86ec77c5dc484dd4 (diff)
downloadhaskell-wip/mp-ghci-opt.tar.gz
-rw-r--r--compiler/GHC/Driver/Session.hs1
-rw-r--r--testsuite/config/ghc2
-rw-r--r--testsuite/driver/testlib.py13
-rw-r--r--testsuite/tests/cmm/should_run/machops/all.T2
-rw-r--r--testsuite/tests/codeGen/should_fail/all.T2
-rw-r--r--testsuite/tests/codeGen/should_run/all.T2
-rw-r--r--testsuite/tests/profiling/should_run/all.T4
-rw-r--r--testsuite/tests/rts/all.T4
8 files changed, 21 insertions, 9 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index f162a0ef8a..a6c7d230d3 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2905,6 +2905,7 @@ dynamic_flags_deps = [
setBackend $ platformDefaultBackend (targetPlatform dflags)
dflags' <- liftEwM getCmdLineState
pure $ gopt_unset dflags' Opt_ByteCodeAndObjectCode
+ pure $ gopt_unset dflags' Opt_InsertBreakpoints
, make_dep_flag defFlag "fglasgow-exts"
(NoArg enableGlasgowExts) "Use individual extensions instead"
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index d6f7a651b0..b34a6f7671 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -92,7 +92,7 @@ config.way_flags = {
'prof_no_auto' : ['-prof', '-static', '-fasm'],
'profasm' : ['-O', '-prof', '-static', '-fprof-auto'],
'profthreaded' : ['-O', '-prof', '-static', '-fprof-auto', '-threaded'],
- 'ghci' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '+RTS', '-I0.1', '-RTS'] + (['-fghci-leak-check'] if not config.compiler_debugged else []),
+ 'ghci' : ['--interactive', '-fallow-optimised-byte-code', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '+RTS', '-I0.1', '-RTS'] + (['-fghci-leak-check'] if not config.compiler_debugged else []),
'ghci_opt' : ['--interactive', '-fallow-optimised-byte-code', '-fno-break-points', '-O', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '+RTS', '-I0.1', '-RTS'] + (['-fghci-leak-check'] if not config.compiler_debugged else []),
'sanity' : ['-debug'],
'threaded1' : ['-threaded', '-debug'],
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 14a4cae9d2..afe35e465d 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -758,6 +758,8 @@ def cmm_src( name, opts ):
opts.cmm_src = True
# JS backend doesn't support Cmm
js_skip(name, opts)
+ # GHCi way doesn't support cmm
+ omit_ways(["ghci"])(name, opts)
def outputdir( odir ):
return lambda name, opts, d=odir: _outputdir(name, opts, d)
@@ -1890,6 +1892,9 @@ def interpreter_run(name: TestName,
delimiter = '===== program output begins here\n'
+ pat = re.compile('-main-is (\w+)')
+ res = pat.search(extra_hc_opts)
+ main_is = res.group(1) if res else "main"
with script.open('w', encoding='UTF-8') as f:
# set the prog name and command-line args to match the compiled
# environment.
@@ -1903,7 +1908,7 @@ def interpreter_run(name: TestName,
f.write('System.IO.hSetBuffering System.IO.stdout System.IO.LineBuffering\n')
# wrapping in GHC.TopHandler.runIO ensures we get the same output
# in the event of an exception as for the compiled program.
- f.write('GHC.TopHandler.runIOFastExit Main.main Prelude.>> Prelude.return ()\n')
+ f.write('GHC.TopHandler.runIOFastExit {main_is} Prelude.>> Prelude.return ()\n'.format(main_is=main_is))
stdin = in_testdir(opts.stdin if opts.stdin else add_suffix(name, 'stdin'))
if stdin.exists():
@@ -1929,6 +1934,12 @@ def interpreter_run(name: TestName,
in_testdir(name, 'comp.stderr'),
in_testdir(name, 'run.stderr'))
+ expected_stderr_file = find_expected_file(name, 'compile-stderr')
+ actual_stderr_file = add_suffix(name, 'comp.stderr')
+ result = check_compile_stderr(way, name, expected_stderr_file, actual_stderr_file)
+ if badResult(result):
+ return result
+
# check the exit code
if exit_code != getTestOpts().exit_code:
if config.verbose >= 1 and _expect_pass(way):
diff --git a/testsuite/tests/cmm/should_run/machops/all.T b/testsuite/tests/cmm/should_run/machops/all.T
index a10500f7c8..7fc034ecdc 100644
--- a/testsuite/tests/cmm/should_run/machops/all.T
+++ b/testsuite/tests/cmm/should_run/machops/all.T
@@ -2,7 +2,7 @@ setTestOpts(extra_files(['TestMachOp.hs']))
def cmm_test(name, ws):
test(name,
- [unless(wordsize(ws), skip), normal],
+ [unless(wordsize(ws), skip), omit_ways(['ghci'])],
multi_compile_and_run,
['TestMachOp', [(name+'.cmm', '')], ''])
diff --git a/testsuite/tests/codeGen/should_fail/all.T b/testsuite/tests/codeGen/should_fail/all.T
index 3f2dacee46..5819efa729 100644
--- a/testsuite/tests/codeGen/should_fail/all.T
+++ b/testsuite/tests/codeGen/should_fail/all.T
@@ -7,7 +7,7 @@ test('T8131', [cmm_src, only_ways(llvm_ways)], compile_fail, ['-no-hs-main'])
def check_bounds_test(name):
""" A -fcheck-prim-bounds test that is expected to fail. """
test(name,
- [ignore_stderr, exit_code(127 if opsys('mingw32') else 134)],
+ [ignore_stderr, omit_ways(['ghci']), exit_code(127 if opsys('mingw32') else 134)],
compile_and_run, ['-fcheck-prim-bounds'])
check_bounds_test('CheckBoundsWriteArray')
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 74f2586fd0..1190f1db22 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -29,7 +29,7 @@ test('cgrun021', extra_ways(['nursery_chunks']), compile_and_run, [''])
test('cgrun022', normal, compile_and_run, [''])
test('cgrun024', normal, compile_and_run, [''])
test('cgrun025',
- [ extra_run_opts('cgrun025.hs < /dev/null'), exit_code(1)],
+ [ omit_ways(["ghci"]), extra_run_opts('cgrun025.hs < /dev/null'), exit_code(1)],
compile_and_run, [''])
test('cgrun026', normal, compile_and_run, [''])
test('cgrun027', normal, compile_and_run, [''])
diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T
index 34d0f5d879..d49653394d 100644
--- a/testsuite/tests/profiling/should_run/all.T
+++ b/testsuite/tests/profiling/should_run/all.T
@@ -21,13 +21,13 @@ def normalise_InfoProv_ipName(str):
return re.sub('ipName = "\\w*"', '', str)
test('staticcallstack001',
- [ omit_ways(['ghci-ext-prof']), # produces a different stack
+ [ omit_ways(['ghci', 'ghci-ext-prof']), # produces a different stack
normalise_fun(normalise_InfoProv_ipName)
], compile_and_run,
['-O0 -g3 -fdistinct-constructor-tables -finfo-table-map'])
test('staticcallstack002',
- [ omit_ways(['ghci-ext-prof']), # produces a different stack
+ [ omit_ways(['ghci', 'ghci-ext-prof']), # produces a different stack
normalise_fun(normalise_InfoProv_ipName)
], compile_and_run,
['-O0 -g3 -fdistinct-constructor-tables -finfo-table-map'])
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 11d96a85aa..1d8fa634c2 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -548,14 +548,14 @@ test('cloneMyStack_retBigStackFrame', [req_c, extra_files(['cloneStackLib.c']),
test('cloneThreadStack', [req_c, only_ways(['threaded1']), extra_ways(['threaded1']), extra_files(['cloneStackLib.c'])], compile_and_run, ['cloneStackLib.c -threaded'])
test('decodeMyStack',
- [ js_broken(22261) # cloneMyStack# not yet implemented
+ [ omit_ways(["ghci"]), js_broken(22261) # cloneMyStack# not yet implemented
], compile_and_run, ['-finfo-table-map'])
# Options:
# - `-kc8K`: Set stack chunk size to it's minimum to provoke underflow stack frames.
test('decodeMyStack_underflowFrames',
[ extra_run_opts('+RTS -kc8K -RTS')
- , js_broken(22261) # cloneMyStack# not yet implemented
+ , omit_ways(["ghci"]), js_broken(22261) # cloneMyStack# not yet implemented
], compile_and_run, ['-finfo-table-map -rtsopts'])
# -finfo-table-map intentionally missing