1 /* { dg-options "-fno-inline" } */
2 /* Check that stack alignment is not affected by variables not placed
9 unsigned test(unsigned n
, unsigned p
)
11 static struct { char __attribute__((__aligned__(ALIGNMENT
))) c
; } s
;
14 assert(__alignof__(s
) == ALIGNMENT
);
15 asm ("" : "=g" (x
), "+m" (s
) : "0" (&x
));
17 return n
? test(n
- 1, x
) : (x
^ p
);
20 unsigned test2(unsigned n
, unsigned p
)
22 static struct { char c
; } s
;
25 assert(__alignof__(s
) != ALIGNMENT
);
26 asm ("" : "=g" (x
), "+m" (s
) : "0" (&x
));
28 return n
? test2(n
- 1, x
) : (x
^ p
);
31 int main (int argc
, char *argv
[] __attribute__((unused
)))
36 x
|= test(argc
+ 1, 0);
37 x
|= test(argc
+ 2, 0);
40 y
|= test2(argc
+ 1, 0);
41 y
|= test2(argc
+ 2, 0);
43 return (x
& (ALIGNMENT
- 1)) == 0 && (y
& (ALIGNMENT
- 1)) != 0 ? 1 : 0;