Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/va-arg-23.c

raw
1 /* PR 9700 */
2 /* Alpha got the base address for the va_list incorrect when there was
3 a structure that was passed partially in registers and partially on
4 the stack. */
5
6 #include <stdarg.h>
7
8 void abort(void);
9
10 struct two { long x, y; };
11
12 void foo(int a, int b, int c, int d, int e, struct two f, int g, ...)
13 {
14 va_list args;
15 int h;
16
17 va_start(args, g);
18 h = va_arg(args, int);
19 if (g != 1 || h != 2)
20 abort ();
21 }
22
23 int main()
24 {
25 struct two t = { 0, 0 };
26 foo(0, 0, 0, 0, 0, t, 1, 2);
27 return 0;
28 }