tests/e2e/test-varargs.c
// Test returning a struct in memory from a vararg function. The return vector is
// passed in rdi.
Test returning a struct in memory from a vararg function. The return vector is
passed in rdi.
Test returning a struct in memory from a vararg function . The return vector is passed in rdi .
struct s return_struct(int c, ...) {
    va_list ap; va_start(ap, c);
    int r = 0;
    for (int i = 0; i < c; i++) r += va_arg(ap, int);
    va_end(ap);
    struct s s;
    s.i[0] = r;
    return s;
}
struct s return_struct ( int c , ... ) { va_list ap ; va_start ( ap , c ) ; int r = 0 ; for ( int i = 0 ; i < c ; i ++ ) r += va_arg ( ap , int ) ; va_end ( ap ) ; struct s s ; s . i [ 0 ] = r ; return s ; }
Test returning a struct in memory from a vararg function.
Test returning a struct in memory from a vararg function .