diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 13:30:00 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 13:30:00 +0000 |
| commit | 90bf56f456e22dcd98458eca14e0b152a5efb179 (patch) | |
| tree | 629f46a15ea13d1d71998355f00d77d5c80052a3 /tests/i/extern-c-struct/program.cps | |
| parent | 4a70e44f06e637762eec0fd875eb94b84c3f4037 (diff) | |
feat(codegen): accept record pointers as variadic arguments
Pointer types to C-struct records now pass unchanged as variadic EXTERN
arguments. Pseudocode values still need a cast to a C type, and records
by value stay rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/extern-c-struct/program.cps')
| -rw-r--r-- | tests/i/extern-c-struct/program.cps | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/i/extern-c-struct/program.cps b/tests/i/extern-c-struct/program.cps index 1954d29..bcb7af4 100644 --- a/tests/i/extern-c-struct/program.cps +++ b/tests/i/extern-c-struct/program.cps @@ -9,8 +9,10 @@ TYPE PSample = ^Sample EXTERN "C" EXTERN_PROCEDURE scale_sample(PSample, C_INT) EXTERN "C" EXTERN_FUNCTION shared_sample() RETURNS PSample EXTERN "C" EXTERN_FUNCTION shared_count() RETURNS C_INT +EXTERN "C" EXTERN_FUNCTION sum_counts(C_INT, ...) RETURNS C_INT DECLARE S : Sample DECLARE P : PSample +DECLARE Q : PSample S.Tag <- (C_CHAR)'S' S.Value <- (C_DOUBLE)1.5 S.Count <- (C_INT)5 @@ -20,3 +22,5 @@ P <- shared_sample() OUTPUT P^.Tag, " ", P^.Value, " ", P^.Count P^.Count <- (C_INT)9 OUTPUT shared_count() +Q <- ^S +OUTPUT sum_counts((C_INT)2, P, Q) |
