gcc/testsuite/gcc.dg/tree-ssa/pr78910.c
raw| 1 | /* PR tree-optimization/78910 - Wrong print-return-value for a negative number |
| 2 | { dg-do compile } |
| 3 | { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | char b[128]; |
| 8 | int l = __builtin_sprintf (b, "%.2d", -1); |
| 9 | __builtin_printf ("b: '%s', length: %d\n", b, l); |
| 10 | if (l != 3) |
| 11 | __builtin_abort (); |
| 12 | return 0; |
| 13 | } |
| 14 | |
| 15 | /* { dg-final { scan-tree-dump-not "abort" "optimized"} } */ |