summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr78910.c
blob: ba5216e58a8965efef89be1ef36ee2da9b624e4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* PR tree-optimization/78910 - Wrong print-return-value for a negative number
   { dg-do compile }
   { dg-options "-O2 -fdump-tree-optimized" } */

int main()
{
  char b[128];
  int l = __builtin_sprintf (b, "%.2d", -1);
  __builtin_printf ("b: '%s', length: %d\n", b, l);
  if (l != 3)
    __builtin_abort ();
  return 0;
}

/* { dg-final { scan-tree-dump-not "abort" "optimized"} } */