| 1 |
/* { dg-do run } */ |
| 2 |
|
| 3 |
extern "C" void abort(void); |
| 4 |
extern "C" void __xtensa_libgcc_window_spill(void); |
| 5 |
|
| 6 |
#ifdef __XTENSA_CALL0_ABI__ |
| 7 |
void __xtensa_libgcc_window_spill(void) |
| 8 |
{ |
| 9 |
} |
| 10 |
#endif |
| 11 |
|
| 12 |
static int call; |
| 13 |
static int cnt; |
| 14 |
|
| 15 |
extern "C" void *memcpy(void *dst, const void *src, unsigned int sz) |
| 16 |
{ |
| 17 |
char *a = (char *)dst; |
| 18 |
const char *b = (const char *)src; |
| 19 |
|
| 20 |
if (call++ == cnt) |
| 21 |
__xtensa_libgcc_window_spill(); |
| 22 |
|
| 23 |
while (sz--) |
| 24 |
*a++ = *b++; |
| 25 |
|
| 26 |
return dst; |
| 27 |
} |
| 28 |
|
| 29 |
int main() |
| 30 |
{ |
| 31 |
int i; |
| 32 |
|
| 33 |
for (i = 0; i < 100; ++i) |
| 34 |
{ |
| 35 |
call = 0; |
| 36 |
cnt = i; |
| 37 |
|
| 38 |
try |
| 39 |
{ |
| 40 |
throw 1; |
| 41 |
} |
| 42 |
catch (int v) |
| 43 |
{ |
| 44 |
if (v != 1) |
| 45 |
abort (); |
| 46 |
} |
| 47 |
} |
| 48 |
return 0; |
| 49 |
} |