PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / fprintf-1.c
blob15996ef22c513d913ca6e9e3a448c129012819bd
1 /* { dg-skip-if "requires io" { freestanding } } */
3 #include <stdio.h>
4 #include <stdlib.h>
6 int
7 main (void)
9 #define test(ret, args...) \
10 fprintf (stdout, args); \
11 if (fprintf (stdout, 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;