test(ffi-linkage): Phase 5.0 prereq — xfail extern C-variadic tail loses its ...

A trailing `..args: []T` on an `extern` fn must map to the C `...` tail
like its `#foreign` twin (example 1218). Today the variadic handling in
both declareFunction (is_variadic drop) and packVariadicCallArgs
(call-site early-out) is gated on `#foreign` only, so a variadic
`extern` keeps the trailing slice param and slice-packs the extras —
garbage at the C ABI (probe: sum_ints(3,10,20,30) → 53316585, not 60).

Example 1229 pins the DESIRED correct output; the next commit extends
both gates to cover extern and greens it. Prerequisite for migrating the
fn-decl `#foreign` path onto `extern`.

645 corpus (1229 xfail), 444 unit.
This commit is contained in:
agra
2026-06-14 21:03:13 +03:00
parent 28d38f2f2f
commit 9a2c78d6b9
5 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
sum_ints(3, 10, 20, 30) = 60
sum_ints(0) = 0
avg_doubles(2) = 2.000000
avg_doubles(3) = 2.000000