Home | History | Annotate | Download | only in jni
      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;
     17         i=j=k=0;
     18   	for (i=0; i < global; i++)
     19 	  for (j=0; j < i; j++)
     20      		global2 = k;
     21 	if (check_int ((int *) &a,  __alignof__(a)) != a)
     22 	  abort ();
     23 	throw 0;
     24 }
     25 
     26 int main()
     27 {
     28 	int ll = 1;
     29         int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
     30 	try {
     31   	  for (; i < global; i++)
     32 	  for (; j < i; j++)
     33 	  for (; k < j; k++)
     34 	  for (; l < k; l++)
     35 	  for (; m < l; m++)
     36 	  for (; n < m; n++)
     37      		global2 = k;
     38 	  bar ();
     39 	}
     40 	catch (...)
     41 	{
     42 	}
     43 	ll = i+j+k+l+m+n;
     44 	if (ll != 15)
     45 	{
     46 #ifdef DEBUG
     47 		printf("FAIL: sum %d != 15\n", ll);
     48 #endif
     49 		abort();
     50 	}
     51 	return 0;
     52 }
     53