| 1 |
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ |
| 2 |
|
| 3 |
#include "test-unwind.h" |
| 4 |
|
| 5 |
#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__ |
| 6 |
double g_f=1.0; |
| 7 |
/* Test situation 6: Stack realign dosn't really happen with DRAP reg DI */ |
| 8 |
void __attribute__ ((noinline)) __attribute__ ((regparm(3))) |
| 9 |
bar(int arg1, int arg2, int arg3, int arg4) |
| 10 |
{ |
| 11 |
char * s = (char *) __builtin_alloca (arg4 + 1); |
| 12 |
|
| 13 |
copy (s, arg4); |
| 14 |
if (__builtin_strncmp (s, "good", arg4) != 0) |
| 15 |
{ |
| 16 |
#ifdef DEBUG |
| 17 |
s[arg4] = '\0'; |
| 18 |
printf ("Failed: %s != good\n", s); |
| 19 |
#endif |
| 20 |
abort (); |
| 21 |
} |
| 22 |
ALTER_REGS(); |
| 23 |
if (g_f) throw arg1+arg2+arg3+ g_f; |
| 24 |
} |
| 25 |
|
| 26 |
void __attribute__((noinline)) |
| 27 |
foo() |
| 28 |
{ |
| 29 |
bar(1,2,3,4); |
| 30 |
} |
| 31 |
#endif |