Debian Codegraph @

gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c

raw
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 typedef int aligned __attribute__((aligned(ALIGNMENT)));
11
12 int global;
13
14 void
15 foo (void)
16 {
17 aligned j;
18
19 __attribute__ ((__noinline__))
20 void bar ()
21 {
22 aligned i;
23
24 if (check_int (&i, __alignof__(i)) != i)
25 abort ();
26
27 if (check_int (&j, __alignof__(j)) != j)
28 abort ();
29
30 j = -20;
31 }
32 bar ();
33
34 if (j != -20)
35 abort ();
36
37 if (check_int (&j, __alignof__(j)) != j)
38 abort ();
39 }
40
41 int
42 main()
43 {
44 foo ();
45 return 0;
46 }