| ... |
... |
@@ -6,8 +6,10 @@ test('T8131', [cmm_src, only_ways(llvm_ways)], compile_fail, ['-no-hs-main']) |
|
6
|
6
|
|
|
7
|
7
|
def check_bounds_test(name):
|
|
8
|
8
|
""" A -fcheck-prim-bounds test that is expected to fail. """
|
|
|
9
|
+ # The native backend exits with EXIT_FAILURE (1); the JS backend still
|
|
|
10
|
+ # aborts with h$exitProcess(134) (the improved messages are native-only).
|
|
9
|
11
|
test(name,
|
|
10
|
|
- [ignore_stderr, omit_ghci, exit_code(1)],
|
|
|
12
|
+ [ignore_stderr, omit_ghci, exit_code(134 if js_arch() else 1)],
|
|
11
|
13
|
compile_and_run, ['-fcheck-prim-bounds'])
|
|
12
|
14
|
|
|
13
|
15
|
check_bounds_test('CheckBoundsWriteArray') # Check past end
|
| ... |
... |
@@ -33,9 +35,10 @@ def strip_prog_prefix(s): |
|
33
|
35
|
return re.sub(r'(?m)^.*?(\w+#: array access)', r'\1', s)
|
|
34
|
36
|
|
|
35
|
37
|
# T26964 checks the single-element message. T26964b checks the range variant.
|
|
|
38
|
+# Skipped on the JS backend, which emits no message and aborts with code 134.
|
|
36
|
39
|
test('T26964',
|
|
37
|
|
- [omit_ghci, exit_code(1), normalise_errmsg_fun(strip_prog_prefix)],
|
|
|
40
|
+ [omit_ghci, js_skip, exit_code(1), normalise_errmsg_fun(strip_prog_prefix)],
|
|
38
|
41
|
compile_and_run, ['-fcheck-prim-bounds'])
|
|
39
|
42
|
test('T26964b',
|
|
40
|
|
- [omit_ghci, exit_code(1), normalise_errmsg_fun(strip_prog_prefix)],
|
|
|
43
|
+ [omit_ghci, js_skip, exit_code(1), normalise_errmsg_fun(strip_prog_prefix)],
|
|
41
|
44
|
compile_and_run, ['-fcheck-prim-bounds']) |