Files
LithosAnanke/v4/tests/rom_asm_cases.h
T
Claude 3bd81097e1 chore(license): an SPDX header on every source file that had none (LicenseRef-Starship-1.0) [skip ci]
The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).

253 files now begin
    SPDX-License-Identifier: LicenseRef-Starship-1.0
    Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.

Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).

Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
2026-11-10 04:12:49 +00:00

119 lines
4.1 KiB
C

/* SPDX-License-Identifier: LicenseRef-Starship-1.0
* Copyright (c) 2023-2026 Robert A. James
*/
/* rom_asm_cases.h -- the texts of v4/tests/test_text.c, accepted and refused, that the ROM's language has
* (no header and no flags). Extracted once from test_text.c; each is given to text.c and to the ROM, and
* test_host_rom_asm.c requires the same outcome. */
static const char *const rom_asm_cases[] = {
": T 123 ;",
": T -5 ;",
": T $FF ;",
": T $ff $Ab + ;",
": T 0 ;",
": T 1 2 3 4 5 6 7 + + + + + + ;",
": T 4294967295 ;",
": T -2147483648 ;",
": T $FFFFFFFF ;",
": T 4294967296 ;",
": T -2147483649 ;",
": T $100000000 ;",
": T 18446744073709551615 ;",
": T -9223372036854775808 ;",
": T $FFFFFFFFFFFFFFFF ;",
": T 18446744073709551616 ;",
": T -9223372036854775809 ;",
": T $10000000000000000 ;",
": T 99999999999999999999999999 ;",
": T VAR ;",
": ST ( x -- ) VAR a! ! ; : LD ( -- x ) VAR a! @ ;",
"\\ a line comment\n: T ( a stack comment ) 7 \\ another\n ( and\n one over two lines ) 8 + ; \\ the end",
": (T) 5 ; : T (T) (T) + ;",
": T 1 ( never closed",
": T @p ;",
": A 3 ; : T A A + ;",
": T A A + ; : A 4 ;",
": T jump A : A 9 ;",
": T call A 1 + ; : A 9 ;",
": A 1 ; : B A A + ; : C B B + ; : T C C + ;",
": T 5 \n : U 1 + ;",
": T ( n -- 1|2 ) if Z drop 1 ; Z: drop 2 ;",
": T ( n -- 0 ) L: if DONE -1 + jump L DONE: ;",
": T ( n -- f ) -if P drop -1 ; P: drop 0 ;",
": A ( n -- 1|2 ) if L drop 1 ; L: drop 2 ; : T ( n -- 3|4 ) if L drop 3 ; L: drop 4 ;",
": L 50 ; : T ( n -- x ) if L drop 1 ; L: drop 2 ;",
": L 50 ; : T ( n -- x ) L: if DONE -1 + jump L DONE: drop 3 ;",
": L drop 50 ; : T ( n -- x ) if L drop 1 ; : U 2 ;",
": L drop 50 ; : T ( n -- x ) if L drop 1 ;",
": T ( n -- x ) if OUT drop 1 ; : OUT drop 77 ;",
": T L: 1 L: 2 ;",
": T if NOWHERE ;\n: U 1 ;",
"\n\n: T 1 MISSING + ;",
": T jump",
": T jump 5 ;",
": T jump VAR ;",
": T jump dup ;",
": T ( n -- n+5 ) 4 FOR 1 + NEXT ;",
": T ( n -- n*8 ) 2 FOR 2* UNEXT ;",
": T ( n -- x ) 1 FOR 2 FOR 2* UNEXT NEXT ;",
": T ( n -- x ) 2 FOR 2* UNEXT 1 + ;",
": T ( n -- x ) 2 FOR dup + 2* nop UNEXT ;",
": T 2 FOR dup + 2* nop nop nop UNEXT ;",
": T 2 FOR 1 + UNEXT ;",
": T NEXT ;",
": T UNEXT ;",
": T 3 FOR 1 + ;\n: U ;",
": T 0 FOR 0 FOR 0 FOR 0 FOR 0 FOR 0 FOR 0 FOR 0 FOR 0 FOR ;",
"macro SWAP over push push drop pop pop endmacro : T ( a b -- b ) SWAP drop ;",
"macro 1+ 1 + endmacro macro 2+ 1+ 1+ endmacro : T 2+ 2+ ;",
"macro TEN ( a comment ) 10 \\ and another\n endmacro : T TEN TEN + ;",
"macro SHL3 2 FOR 2* UNEXT endmacro : T SHL3 ;",
": A 6 ; macro CALLS A A + endmacro : T CALLS ;",
"macro NOTHING endmacro : T 5 NOTHING ;",
"macro M L: endmacro",
"macro M : X ; endmacro",
"macro M macro N endmacro endmacro",
"macro M 1 2 3",
"macro",
": T endmacro ;",
"macro M M endmacro : T M ;",
": A 1 ;\n: A 2 ;",
": VAR 1 ;",
"macro A 1 endmacro : A 2 ;",
": dup 1 ;",
": 12 1 ;",
": FOR 1 ;",
"macro + 1 endmacro",
": X: 1 ;",
":",
": T THIS-NAME-IS-MUCH-TOO-LONG-TO-BE-A-NAME-IN-THIS-ASSEMBLER-BY-A-WIDE-MARGIN ;",
": Dup 3 ; : T Dup Dup + ;",
": 2DUP over over ; : 1+ 1 + ; : T ( a b -- 2a+2b+1 ) 2DUP + + + 1+ ;",
": T VAR+3 ;",
": T VAR+0 VAR+10 + ;",
": VAR+1 77 ; : T VAR+1 ;",
": T VAR+ ;",
": T VAR+x ;",
": T NOPE+1 ;",
": A 5 ; : T &A ;",
": A 5 ; : T &A push ;",
": T &A ; : A 5 ;",
": T &VAR ;",
": &X 1 ;",
": T 1 ;",
": T 1 ;\n: T 2 ;",
"constant SEVEN 7 constant MINUS -2 constant BIG $7F : T SEVEN MINUS + BIG + ;",
"constant K 3 : T K+2 ;",
"constant K 3 constant K 4",
"constant dup 3",
"constant K",
"constant K x",
": constant ;",
"constant K 9 : T ; #, 5 #, -1 #, K #, K+2 #, &T \", ab \", ( \", abcde",
": T dup #, 7 ;",
"#, x",
"#,",
"\",",
": #, ;",
": \", ;",
};