aboutsummaryrefslogtreecommitdiff
path: root/test/builtin-vaarg-vm.c
blob: aee721672fa98be2df3d8bad8062f43f3894b55f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int f(int i, ...) {
	int r, c = 0;
	__builtin_va_list ap;

	__builtin_va_start(ap, i);
	r = **__builtin_va_arg(ap, int (*)[++i]);
	__builtin_va_end(ap);
	return r + i;
}

int main(void) {
	int a[3];

	a[0] = 123;
	return f(3, &a) != 127;
}