* except.c (free_eh_nesting_info): Free the info itself.
[official-gcc.git] / libio / tests / tstdiomisc.c
blobcd8e88fd6cec33c2dcca3747221df08dcf1936fa
1 #ifndef STDIO_H
2 #define STDIO_H <iostdio.h>
3 #endif
4 #include STDIO_H
6 void
7 t1 ()
9 int n = -1;
10 sscanf ("abc ", "abc %n", &n);
11 printf ("t1: count=%d\n", n);
14 void
15 t2 ()
17 int n;
18 long N;
19 int retval;
20 #define SCAN(INPUT, FORMAT, VAR) \
21 VAR = -1; \
22 retval = sscanf (INPUT, FORMAT, &VAR); \
23 printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
24 INPUT, FORMAT, retval, (long)VAR);
26 SCAN ("12345", "%ld", N);
27 SCAN ("12345", "%llllld", N);
28 SCAN ("12345", "%LLLLLd", N);
29 SCAN ("test ", "%*s%n", n);
30 SCAN ("test ", "%2*s%n", n);
31 SCAN ("12 ", "%l2d", n);
32 SCAN ("12 ", "%2ld", N);
35 int
36 main ()
38 t1 ();
39 t2 ();
41 fflush (stdout);
42 return 0;