gcc/testsuite/gcc.c-torture/execute/930513-1.c
raw| 1 | /* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */ |
| 2 | /* { dg-additional-options "-std=gnu89" } */ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | char buf[2]; |
| 6 | |
| 7 | f (fp) |
| 8 | int (*fp)(char *, const char *, ...); |
| 9 | { |
| 10 | (*fp)(buf, "%.0f", 5.0); |
| 11 | } |
| 12 | |
| 13 | main () |
| 14 | { |
| 15 | f (&sprintf); |
| 16 | if (buf[0] != '5' || buf[1] != 0) |
| 17 | abort (); |
| 18 | exit (0); |
| 19 | } |