aboutsummaryrefslogtreecommitdiff
path: root/test/varargs+x86_64-sysv.c
blob: 71bf1d37ff07a55fe7ae52d532f98c3960ecd32b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int f1(int n, __builtin_va_list ap) {
	return __builtin_va_arg(ap, int);
}

int f2(int n, ...) {
	int r;
	__builtin_va_list ap;

	__builtin_va_start(ap, n);
	r = f1(n, ap);
	__builtin_va_end(ap);
	return r;
}

void f3(int n, ...) {
	__builtin_va_list ap;

	__builtin_va_start(ap, n);
	while (n) {
		__builtin_va_arg(ap, int);
		__builtin_va_arg(ap, float);
		__builtin_va_arg(ap, char *);
		--n;
	}
	__builtin_va_end(ap);
}