fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libgloss / testsuite / libgloss.all / varargs.c
blobc055574dc9ba6f919a9845a52bdf3190b27a0014
1 /* Oki bug report [OKI013]
3 Variable argments test failed.
5 Execution result.
6 val1, val2 = 1, 0
7 val1, val2 = 2, 0
8 val1, val2 = 3, 0
10 Note, this tests for ANSI style varargs.
14 #include <stdio.h>
15 #include <stdarg.h>
16 int func(int, ...);
18 main()
20 func(2, 1., 2., 3.);
23 func(int i, ...)
25 va_list p;
26 int j;
28 va_start(p, i);
29 for (j = 1; j <= 3; ++j){
30 dequals(__LINE__, (double)j, va_arg(p, double));
32 va_end(p);
33 return (i);
36 dequals(int line, double val1, double val2)
38 iprintf ("val1, val2 = %d, %d\n", (int)val1, (int)val2);
39 if(val1 == val2)
40 pass ("varargs [OKI013]");
41 else
42 fail ("varargs [OKI013]");
44 fflush (stdout);
45 return;