diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 13:27:15 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 13:27:15 +0000 |
| commit | 4a70e44f06e637762eec0fd875eb94b84c3f4037 (patch) | |
| tree | b2771f76e3da335276a8c3e96ce70c2cfe99e088 /tests/iii/extern-struct-rejected/program.cps | |
| parent | eaad9c34403f05372c1544d7ef522c847dfea0ba (diff) | |
feat(codegen): accept pointers to C-struct records in EXTERN signatures
A TYPE record whose fields are all C types, C structs or pointer types to
C structs now crosses the EXTERN "C" boundary through a pointer type.
Records by value are rejected for now, and a pointer to a record with a
non-C field names that field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii/extern-struct-rejected/program.cps')
| -rw-r--r-- | tests/iii/extern-struct-rejected/program.cps | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/iii/extern-struct-rejected/program.cps b/tests/iii/extern-struct-rejected/program.cps new file mode 100644 index 0000000..e7f38d1 --- /dev/null +++ b/tests/iii/extern-struct-rejected/program.cps @@ -0,0 +1,14 @@ +// Records cross the EXTERN boundary only as C structs through a pointer type. +INCLUDE_OBJ "__libc" +TYPE Person + DECLARE Name : STRING + DECLARE Age : C_INT +ENDTYPE +TYPE PPerson = ^Person +TYPE Point + DECLARE X : C_INT + DECLARE Y : C_INT +ENDTYPE +EXTERN "C" EXTERN_PROCEDURE puts(PPerson) +EXTERN "C" EXTERN_FUNCTION abs(Point) RETURNS C_INT +OUTPUT 1 |
