Debian Codegraph @

gcc/testsuite/gcc.dg/lto/20090706-1_0.c

raw
1 #include <stdarg.h>
2
3 extern void abort (void);
4
5 void foo (int size, ...)
6 {
7 struct
8 {
9 struct
10 {
11 char x[size];
12 } e;
13 unsigned r;
14 } d;
15 va_list ap;
16 char c;
17 int i;
18
19 va_start (ap, size);
20 d = va_arg (ap, typeof (d));
21 c = d.e.x[3];
22 if (c != '3')
23 abort ();
24 if (d.r != 2602)
25 abort ();
26 va_end (ap);
27 }
28
29 int main (void)
30 {
31 int z = 5, i;
32 struct { struct { char a[z]; } y; unsigned r; } x;
33
34 x.y.a[0] = '0';
35 x.y.a[1] = '1';
36 x.y.a[2] = '2';
37 x.y.a[3] = '3';
38 x.y.a[4] = '4';
39 x.r = 2602;
40 foo (z, x);
41 return 0;
42 }