OSDN Git Service

PR rtl-optimization/40861
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vmx / bug-1.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <stddef.h>
4 #include <altivec.h>
5
6 #define NPAGES 20
7 #define NSKIP 10
8 static vector float big[NPAGES*4096/16] = { {1,1,1,1} };
9 /* NPAGES pages worth.  */
10
11 static int failed;
12
13 static void f(vector float *p)
14 {
15   int i = 1;
16   p = (vector float *)(((ptrdiff_t)p + 4095) & ~4095);
17
18   i += NSKIP;
19   p += NSKIP*4096/16;
20
21   while (i < NPAGES)
22     {
23       if (!vec_all_eq(*p,((vector float){0,0,0,0})))
24         {
25           printf("*p isn't zero at 0x%p, page %d\n", p, i);
26           failed++;
27         }
28       i++;
29       p += 4096/16;
30     }
31 }
32
33 int main(void)
34 {
35   f(big);
36   if (failed)
37     abort ();
38   return 0;
39 }