| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ |
| 3 |
|
| 4 |
#include "check.h" |
| 5 |
|
| 6 |
#ifndef ALIGNMENT |
| 7 |
#define ALIGNMENT 64 |
| 8 |
#endif |
| 9 |
|
| 10 |
extern void abort(); |
| 11 |
typedef struct my_struct |
| 12 |
{ |
| 13 |
char str[31]; |
| 14 |
} stype ; |
| 15 |
|
| 16 |
stype g_s; |
| 17 |
|
| 18 |
stype __attribute__((noinline)) |
| 19 |
foo (char arg1, char arg2, char arg3) |
| 20 |
{ |
| 21 |
stype __attribute__((aligned(ALIGNMENT))) s; |
| 22 |
s.str[0] = arg1; |
| 23 |
s.str[1] = arg2; |
| 24 |
s.str[30] = arg3; |
| 25 |
check(&s, ALIGNMENT); |
| 26 |
return s; |
| 27 |
} |
| 28 |
|
| 29 |
int main() |
| 30 |
{ |
| 31 |
g_s = foo(1,2,3); |
| 32 |
|
| 33 |
if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3) |
| 34 |
abort(); |
| 35 |
return 0; |
| 36 |
} |