summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/lto/20081024_0.c
blob: 9fa297abc0e5e15e5be780e5e0de5a200afb8438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-lto-do run } */

#include <stdarg.h>
#include <stdio.h>
#include <string.h>

char *
myprintf (const char *fmt, ...)
{
  va_list args;
  static char buf[80];

  va_start (args, fmt);
  (void) vsnprintf (buf, sizeof (buf), fmt, args);
  va_end (args);
  return buf;
}

int
main ()
{
  char *s;

  s = myprintf ("%s: %d\n", "foo", 1);
  return strcmp (s, "foo: 1\n") != 0;
}