PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 931004-14.c
blob55c71bbc42a29c1d21cef01848e7e7ebc62350f3
1 #include <stdarg.h>
3 struct tiny
5 char c;
6 char d;
7 char e;
8 char f;
9 };
11 f (int n, ...)
13 struct tiny x;
14 int i;
16 va_list ap;
17 va_start (ap,n);
18 for (i = 0; i < n; i++)
20 x = va_arg (ap,struct tiny);
21 if (x.c != i + 10)
22 abort();
23 if (x.d != i + 20)
24 abort();
25 if (x.e != i + 30)
26 abort();
27 if (x.f != i + 40)
28 abort();
31 long x = va_arg (ap, long);
32 if (x != 123)
33 abort();
35 va_end (ap);
38 main ()
40 struct tiny x[3];
41 x[0].c = 10;
42 x[1].c = 11;
43 x[2].c = 12;
44 x[0].d = 20;
45 x[1].d = 21;
46 x[2].d = 22;
47 x[0].e = 30;
48 x[1].e = 31;
49 x[2].e = 32;
50 x[0].f = 40;
51 x[1].f = 41;
52 x[2].f = 42;
53 f (3, x[0], x[1], x[2], (long) 123);
54 exit(0);