PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / printf-1.c
blob654e62766a85e879a3c0a3920788a3845415d1db
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 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;