Add compile command to each testcase
[gcc-vect-testsuite.git] / pr49038.c
blob91c214ffd4ca50d7a222cd76f8a67d6b044b8b28
1 #include <sys/mman.h>
2 #include <stdio.h>
4 #define COUNT 320
5 #define MMAP_SIZE 0x10000
6 #define ADDRESS 0x1122000000
7 #define TYPE unsigned short
9 #ifndef MAP_ANONYMOUS
10 #define MAP_ANONYMOUS MAP_ANON
11 #endif
13 void __attribute__((noinline))
14 foo (TYPE *__restrict a, TYPE *__restrict b)
16 int n;
18 for (n = 0; n < COUNT; n++)
19 a[n] = b[n * 2];
22 int
23 main (void)
25 void *x;
26 size_t b_offset;
28 x = mmap ((void *) ADDRESS, MMAP_SIZE, PROT_READ | PROT_WRITE,
29 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
30 if (x == MAP_FAILED)
32 perror ("mmap");
33 return 1;
36 b_offset = MMAP_SIZE - (2 * COUNT - 1) * sizeof (TYPE);
37 foo ((unsigned short *) x,
38 (unsigned short *) ((char *) x + b_offset));
39 return 0;
42 /* { dg-final { cleanup-tree-dump "vect" } } */