]>
Commit | Line | Data |
---|---|---|
3b2488ca | 1 | /* { dg-do run } */ |
4f4b0ab8 RO |
2 | /* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */ |
3 | /* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } } */ | |
3b2488ca L |
4 | |
5 | #include "check.h" | |
6 | ||
7 | #ifndef ALIGNMENT | |
8 | #define ALIGNMENT 64 | |
9 | #endif | |
10 | ||
11 | typedef int aligned __attribute__((aligned(ALIGNMENT))); | |
12 | ||
13 | int global; | |
14 | ||
15 | void | |
16 | foo (void) | |
17 | { | |
18 | aligned j; | |
19 | ||
20 | __attribute__ ((__noinline__)) | |
21 | void bar () | |
22 | { | |
23 | aligned i; | |
24 | ||
25 | if (check_int (&i, __alignof__(i)) != i) | |
26 | abort (); | |
27 | ||
28 | if (check_int (&j, __alignof__(j)) != j) | |
29 | abort (); | |
30 | ||
31 | j = -20; | |
32 | } | |
33 | bar (); | |
34 | ||
35 | if (j != -20) | |
36 | abort (); | |
37 | ||
38 | if (check_int (&j, __alignof__(j)) != j) | |
39 | abort (); | |
40 | } | |
41 | ||
42 | int | |
43 | main() | |
44 | { | |
45 | foo (); | |
46 | return 0; | |
47 | } |