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-*-* } } */ 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 foo(void)16foo (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 main()43main() 44 { 45 foo (); 46 return 0; 47 } 48