1 /* { dg-do run } */ 2 3 #include "check.h" 4 5 #ifndef ALIGNMENT 6 #define ALIGNMENT 64 7 #endif 8 9 typedef int t_align __attribute__((aligned(ALIGNMENT))); 10 11 12 int global, global2; 13 void bar() 14 { 15 volatile t_align a = 1; 16 int i,j,k,l,m,n; 17 i=j=k=0; 18 for (i=0; i < global; i++) 19 for (j=0; j < i; j++) 20 for (k=0; k < j; k++) 21 for (l=0; l < k; l++) 22 for (m=0; m < l; m++) 23 for (n=0; n < m; n++) 24 global2 = k; 25 if (check_int ((int *) &a, __alignof__(a)) != a) 26 abort (); 27 throw 0; 28 } 29 30 void foo() 31 { 32 bar(); 33 } 34 35 int main() 36 { 37 int ll = 1; 38 int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5; 39 try { 40 for (; i < global; i++) 41 for (; j < i; j++) 42 for (; k < j; k++) 43 for (; l < k; l++) 44 for (; m < l; m++) 45 for (; n < m; n++) 46 global2 = k; 47 foo(); 48 } 49 catch (...) 50 { 51 } 52 ll = i+j+k+l+m+n; 53 if (ll != 15) 54 { 55 #ifdef DEBUG 56 printf("FAIL: sum %d != 15\n", ll); 57 #endif 58 abort(); 59 } 60 return 0; 61 } 62