1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 typedef __SIZE_TYPE__
size_t;
5 extern void __chk_fail (void);
6 extern int snprintf (char *, size_t, const char *, ...);
7 extern inline __attribute__((gnu_inline
, always_inline
)) int snprintf (char *a
, size_t b
, const char *fmt
, ...)
9 if (__builtin_object_size (a
, 0) != -1UL && __builtin_object_size (a
, 0) < b
)
11 return __builtin_snprintf (a
, b
, fmt
, __builtin_va_arg_pack ());
13 extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf");
20 snprintf (buf
, 10, "%d%d\n", 10, 10);
24 /* { dg-final { scan-assembler "mysnprintf" } } */
25 /* { dg-final { scan-assembler-not "__chk_fail" } } */