diff options
| author | _ov4 <ov4@ov4.one> | 2026-10-16 20:53:57 +0800 |
|---|---|---|
| committer | _ov4 <ov4@ov4.one> | 2026-10-16 20:53:57 +0800 |
| commit | f1f01c0622a9045e26335f5715a42342d0191dcd (patch) | |
| tree | 250248d8d154dd3e1dd288169dcf976bf43e55bf /tests/iii/function-byref | |
| parent | d19f9ddb866ac2415cbfe66966897a8efe8ddb63 (diff) | |
test(diagnostics): require accurate causes and source lines
Check native and IR rejection without creating or replacing output files.
Keep nine missing-location failures visible rather than accepting them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii/function-byref')
| -rw-r--r-- | tests/iii/function-byref/case.json | 8 | ||||
| -rw-r--r-- | tests/iii/function-byref/notes.md | 5 | ||||
| -rw-r--r-- | tests/iii/function-byref/program.cps | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/iii/function-byref/case.json b/tests/iii/function-byref/case.json new file mode 100644 index 0000000..e879655 --- /dev/null +++ b/tests/iii/function-byref/case.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "reason": "BYREF\\ parameters\\ are\\ not\\ allowed\\ in\\ a\\ FUNCTION", + "line": 2 + } + ] +} diff --git a/tests/iii/function-byref/notes.md b/tests/iii/function-byref/notes.md new file mode 100644 index 0000000..4063bff --- /dev/null +++ b/tests/iii/function-byref/notes.md @@ -0,0 +1,5 @@ +# function-byref + +CIE p. 24 explicitly prohibits passing function parameters by reference. + +Require exit 1, the stated cause and source line on the same diagnostic, exactly one compilation termination line, and preservation of absent/existing outputs for both native and IR requests. Missing block delimiters are located at EOF (the line after the final newline). diff --git a/tests/iii/function-byref/program.cps b/tests/iii/function-byref/program.cps new file mode 100644 index 0000000..1cc89cb --- /dev/null +++ b/tests/iii/function-byref/program.cps @@ -0,0 +1,4 @@ +// BYREF is procedure-only. +FUNCTION Bad(BYREF X : INTEGER) RETURNS INTEGER + RETURN X +ENDFUNCTION |
