aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-1.c
blob: fdf392d5f9b09c1c18b6c096c4064038beaf3113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <altivec.h>

#define NPAGES 20
#define NSKIP 10
static vector float big[NPAGES*4096/16] = { {1,1,1,1} };
/* NPAGES pages worth.  */

static int failed;

static void f(vector float *p)
{
  int i = 1;
  p = (vector float *)(((ptrdiff_t)p + 4095) & ~4095);

  i += NSKIP;
  p += NSKIP*4096/16;

  while (i < NPAGES)
    {
      if (!vec_all_eq(*p,((vector float){0,0,0,0})))
	{
	  printf("*p isn't zero at 0x%p, page %d\n", p, i);
	  failed++;
	}
      i++;
      p += 4096/16;
    }
}

int main(void)
{
  f(big);
  if (failed)
    abort ();
  return 0;
}