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:
1
examples/expected/1229-ffi-extern-cvariadic.exit
Normal file
1
examples/expected/1229-ffi-extern-cvariadic.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
examples/expected/1229-ffi-extern-cvariadic.stderr
Normal file
1
examples/expected/1229-ffi-extern-cvariadic.stderr
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
4
examples/expected/1229-ffi-extern-cvariadic.stdout
Normal file
4
examples/expected/1229-ffi-extern-cvariadic.stdout
Normal 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
|
||||
Reference in New Issue
Block a user