1 /* Test there is no ICE when compile. */
2 /* { dg-do compile } */
4 #define PRINTF_CHK 0x34
6 typedef __UINTPTR_TYPE__
uintptr_t;
8 struct __printf_buffer
{
13 extern void __printf_buffer_init_end (struct __printf_buffer
*, char *, char *);
16 test (char *string
, unsigned long maxlen
, unsigned mode_flags
)
18 struct __printf_buffer buf
;
20 if ((mode_flags
& PRINTF_CHK
) != 0)
25 if (__builtin_add_overflow ((uintptr_t) string
, maxlen
, &end
))
28 __printf_buffer_init_end (&buf
, string
, (char *) end
);
31 __printf_buffer_init_end (&buf
, string
, (char *) ~(uintptr_t) 0);
33 *buf
.write_ptr
= '\0';