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 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 main()42main() 43 { 44 foo (); 45 return 0; 46 } 47