1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Warray-bounds" } */
3 /* based on PR 31227 */
5 typedef __SIZE_TYPE__
size_t;
7 extern size_t strlen (const char *);
19 const char *abmon
[12];
24 extern void foo (size_t, struct iovec
*);
31 iov
[0].iov_base
= (void *) "abc";
34 iov
[1].iov_base
= (void *) "def";
37 for (cnt
= 0; cnt
< 7; ++cnt
)
39 iov
[2 + cnt
].iov_base
= (void *) (time
->abday
[cnt
] ?: "");
40 iov
[2 + cnt
].iov_len
= strlen (iov
[2 + cnt
].iov_base
) + 1;
43 for (; cnt
< 14; ++cnt
)
45 iov
[2 + cnt
].iov_base
= (void *) (time
->day
[cnt
- 7] ?: "");
46 iov
[2 + cnt
].iov_len
= strlen (iov
[2 + cnt
].iov_base
) + 1;
49 for (; cnt
< 26; ++cnt
)
51 iov
[2 + cnt
].iov_base
= (void *) (time
->abmon
[cnt
- 14] ?: "");
52 iov
[2 + cnt
].iov_len
= strlen (iov
[2 + cnt
].iov_base
) + 1;
55 for (; cnt
< 38; ++cnt
)
57 iov
[2 + cnt
].iov_base
= (void *) (time
->mon
[cnt
- 26] ?: "");
58 iov
[2 + cnt
].iov_len
= strlen (iov
[2 + cnt
].iov_base
) + 1;
61 for (; cnt
< 40; ++cnt
)
63 iov
[2 + cnt
].iov_base
= (void *) (time
->am_pm
[cnt
- 38] ?: "");
64 iov
[2 + cnt
].iov_len
= strlen (iov
[2 + cnt
].iov_base
) + 1;
73 struct malloc_chunk
* fd
;
74 struct malloc_chunk
* bk
;
76 typedef struct malloc_chunk
* mchunkptr
;
79 mchunkptr last_remainder
;
80 mchunkptr bins
[128 * 2 - 2];
82 #define bin_at(m, i) \
83 (mchunkptr) (((char *) &((m)->bins[((i) - 1) * 2])) \
84 - __builtin_offsetof (struct malloc_chunk, fd))
86 void malloc_init_state(struct malloc_state
*av
)
91 for (i
= 1; i
< 128; ++i
) {
93 bin
->fd
= bin
->bk
= bin
;
97 typedef unsigned short WCHAR
;
98 typedef WCHAR
*LPWSTR
;
100 static void g(LPWSTR dest
, int len
) {