/* * C-FFI variadic test fixture (C1, catB-54). A va_arg(double) summer the * ww caller links against to prove the SysV AL=XMM-count fix: the callee * gates its xmm-save-area stores on `test %al,%al`, so a wrong AL makes * these va_arg(double) reads pull garbage. * * Built self-contained (zero relocs, zero undef syms) so w6l can link it * with no libc — verified via readelf -r / nm. Do not add any call that * pulls in a libc symbol. */ #include double fixture(long n, ...) { va_list ap; double s; long i; va_start(ap, n); s = 0; for(i = 0; i < n; i++) s += va_arg(ap, double); va_end(ap); return s; }