comparison libmudflap/testsuite/libmudflap.c/pass49-frag.c @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 #include <stdlib.h>
2 #include <ctype.h>
3 #include <stdarg.h>
4
5 int foo (int a, ...)
6 {
7 va_list args;
8 char *a1;
9 int a2;
10 int k;
11
12 va_start (args, a);
13 for (k = 0; k < a; k++)
14 {
15 if ((k % 2) == 0)
16 {
17 char *b = va_arg (args, char *);
18 printf ("%s", b);
19 }
20 else
21 {
22 int b = va_arg (args, int);
23 printf ("%d", b);
24 }
25 }
26 va_end (args);
27 return a;
28 }
29
30 int main ()
31 {
32 foo (7, "hello ", 5, " ", 3, " world ", 9, "\n");
33 return 0;
34 }
35 /* { dg-output "hello 5 3 world 9" } */