diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 15:22:23 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 15:22:23 +0000 |
| commit | f7f5df01c416a10e3eb9508a7a7150c792a8b4ca (patch) | |
| tree | 9d1fc624c74c129b24fe8b8a6f921f50b799e09a /tests/i/multifile-extern/program.cps | |
| parent | 09498bb7aab9182ba172aae1045ca895d4f422d4 (diff) | |
feat(codegen): allow identical EXTERN redeclarations across files
Repeated EXTERN declarations with the same signature share one C symbol,
as C declarations do; conflicting signatures are errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/multifile-extern/program.cps')
| -rw-r--r-- | tests/i/multifile-extern/program.cps | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/i/multifile-extern/program.cps b/tests/i/multifile-extern/program.cps new file mode 100644 index 0000000..7a0cd2d --- /dev/null +++ b/tests/i/multifile-extern/program.cps @@ -0,0 +1,6 @@ +// Both files declare the same C function; aliases of int are interchangeable. +INCLUDE "lib.cps" +INCLUDE_OBJ "__libc" +EXTERN "C" EXTERN_FUNCTION abs(C_INT) RETURNS C_INT +OUTPUT abs((C_INT)-3) +OUTPUT Twice((C_INT)-4) |
