Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / stackalign / ret-struct-1.c
blobbb1b4a1e6c9dde592af1b2e9fddd58c89111fdbe
1 /* { dg-do run } */
2 /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
3 /* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
5 #include "check.h"
7 #ifndef ALIGNMENT
8 #define ALIGNMENT 64
9 #endif
11 extern void abort();
12 typedef struct my_struct
14 char str[31];
15 } stype ;
17 stype g_s;
19 stype __attribute__((noinline))
20 foo (char arg1, char arg2, char arg3)
22 stype __attribute__((aligned(ALIGNMENT))) s;
23 s.str[0] = arg1;
24 s.str[1] = arg2;
25 s.str[30] = arg3;
26 check(&s, ALIGNMENT);
27 return s;
30 int main()
32 g_s = foo(1,2,3);
34 if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3)
35 abort();
36 return 0;