| 1 |
/* Test that stack alignment is preserved with pending_stack_adjust |
| 2 |
with stdcall functions. */ |
| 3 |
|
| 4 |
/* { dg-do run } */ |
| 5 |
/* { dg-require-effective-target ia32 } */ |
| 6 |
/* { dg-options -mpreferred-stack-boundary=4 } */ |
| 7 |
|
| 8 |
void __attribute__((stdcall)) foo(int a, int b, int c); |
| 9 |
|
| 10 |
extern void abort (void); |
| 11 |
extern void exit (int); |
| 12 |
|
| 13 |
int |
| 14 |
main () |
| 15 |
{ |
| 16 |
foo(1, 2, 3); |
| 17 |
foo(1, 2, 3); |
| 18 |
exit (0); |
| 19 |
} |
| 20 |
|
| 21 |
void __attribute__((stdcall)) |
| 22 |
foo(int a, int b, int c) |
| 23 |
{ |
| 24 |
static int last_align = -1; |
| 25 |
int dummy, align = (int)&dummy & 15; |
| 26 |
if (last_align < 0) |
| 27 |
last_align = align; |
| 28 |
else if (align != last_align) |
| 29 |
abort (); |
| 30 |
} |