Add _FloatN, _FloatNx tests for __builtin_fpclassify.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr56407.c
blobf26fd23f77fdf5532b7b38cf15da626606716c1b
1 /* { dg-do run } */
3 extern void abort(void);
4 extern int rand(void);
6 static void copy(int *r,int *a,int na)
8 int i;
9 for( i = 0 ; i < na ; i++ )
10 r[i] = a[i];
13 static void foo(int *a,int na)
15 int i;
16 for( i = 0 ; i < na ; i++ )
17 a[i] = rand();
20 static int cmp(int *a,int *b,int n)
22 int i;
23 for( i = 0 ; i < n ; i++ )
24 if ( a[i] != b[i] )
25 return -1;
26 return 0;
29 void __attribute__((noinline,noclone))
30 test(int sz,int comm)
32 int j,n;
33 int v[64],w[64];
34 for( j = 1 ; j <= sz ; j++ )
36 n = (2 * j - 1) * (2 * j - 1);
37 foo(w,n);
38 copy(v,w,n);
39 if ( comm )
40 if ( cmp(v,w,n) ) abort ();
44 int main()
46 test(2,1);
47 return 0;