1 /* { dg-skip-if "requires io" { freestanding } { "*" } { "" } }  */
2 
3 #include <stdio.h>
4 #include <stdlib.h>
5 
6 int
main(void)7 main (void)
8 {
9 #define test(ret, args...) \
10   printf (args); 		\
11   if (printf (args) != ret)	\
12     abort ();
13   test (5, "hello");
14   test (6, "hello\n");
15   test (1, "a");
16   test (0, "");
17   test (5, "%s", "hello");
18   test (6, "%s", "hello\n");
19   test (1, "%s", "a");
20   test (0, "%s", "");
21   test (1, "%c", 'x');
22   test (7, "%s\n", "hello\n");
23   test (2, "%d\n", 0);
24   return 0;
25 }
26