1 /* This testcase used to fail because a miscompiled execute_fold_all_builtins. */
2 /* { dg-options "-fgnu89-inline" } */
3 /* { dg-require-effective-target int32plus } */
4 
5 typedef __SIZE_TYPE__ size_t;
6 extern __inline __attribute__ ((__always_inline__)) int __attribute__
snprintf(char * __restrict __s,size_t __n,__const char * __restrict __fmt,...)7 ((__nothrow__)) snprintf (char *__restrict __s, size_t __n, __const char
8 *__restrict __fmt, ...)  {
9   return __builtin___snprintf_chk (__s, __n, 2 - 1,
10 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
11 }
12 int n1, n2, n3, n4, f5, f6;
BackgroundGetUniqueString(void)13 char * BackgroundGetUniqueString(void)
14 {
15   char s[256];
16   const char *chmap =
17 "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
18   snprintf(s, sizeof(s),
19 "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
20            chmap[(n1 >> 0) & 0x3f], chmap[(n1 >> 6) & 0x3f],
21            chmap[(n1 >> 12) & 0x3f], chmap[(n1 >> 18) & 0x3f],
22            chmap[(n1 >> 24) & 0x3f], chmap[(n1 >> 28) & 0x3f],
23            chmap[(n2 >> 0) & 0x3f], chmap[(n2 >> 6) & 0x3f],
24            chmap[(n2 >> 12) & 0x3f], chmap[(n2 >> 18) & 0x3f],
25            chmap[(n2 >> 24) & 0x3f], chmap[(n2 >> 28) & 0x3f],
26            chmap[(n3 >> 0) & 0x3f], chmap[(n3 >> 6) & 0x3f],
27            chmap[(n3 >> 12) & 0x3f], chmap[(n3 >> 18) & 0x3f],
28            chmap[(n3 >> 24) & 0x3f], chmap[(n3 >> 28) & 0x3f],
29            chmap[(n4 >> 0) & 0x3f], chmap[(n4 >> 6) & 0x3f],
30            chmap[(n4 >> 12) & 0x3f], chmap[(n4 >> 18) & 0x3f],
31            chmap[(n4 >> 24) & 0x3f], chmap[(n4 >> 28) & 0x3f],
32            chmap[(f5 >> 12) & 0x3f], chmap[(f5 >> 18) & 0x3f],
33            chmap[(f5 >> 24) & 0x3f], chmap[(f5 >> 28) & 0x3f],
34            chmap[(f6 >> 0) & 0x3f], chmap[(f6 >> 6) & 0x3f]
35            );
36   return __builtin_strdup(s);
37 }
38