Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / pr104380.c
blob54b2a87cf4453987c744233cb0116e33bb854556
1 /* PR target/104380 */
2 /* This test needs runtime that provides __*_chk functions. */
3 /* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */
4 /* { dg-options "-O2 -std=c99" } */
6 #define FORTIFY_SOURCE 2
7 #include <stdio.h>
8 #include <stdarg.h>
10 static char buf[4096];
11 static char gfmt[] = "%Lg";
13 static int __attribute__ ((noipa))
14 foo (char *str, const char *fmt, ...)
16 int ret;
17 va_list ap;
18 va_start (ap, fmt);
19 ret = vsnprintf (str, 4096, fmt, ap);
20 va_end (ap);
21 return ret;
24 int
25 main ()
27 long double dval = 128.0L;
28 int ret = foo (buf, gfmt, dval);
29 if (ret != 3 || __builtin_strcmp (buf, "128") != 0)
30 __builtin_abort ();
31 return 0;