OSDN Git Service

* doc/loop.texi: Document possibility not to perform disambiguation
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-strided-a-u32-mult.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 128
7
8 typedef struct {
9    unsigned int a;
10    unsigned int b;
11 } ii;
12
13 int
14 main1 ()
15 {
16   unsigned short arr[N];
17   unsigned short *ptr = arr;
18   ii iarr[N];
19   ii *iptr = iarr;
20   unsigned short res[N];
21   ii ires[N];
22   int i;
23
24   for (i = 0; i < N; i++)
25     {
26       arr[i] = i;
27       iarr[i].a = i;
28       iarr[i].b = i * 3;
29       if (arr[i] == 178)
30          abort();
31     }
32
33   for (i = 0; i < N; i++)
34     {
35       ires[i].a = iptr->b - iptr->a;
36       ires[i].b = iptr->b + iptr->a;
37       res[i] = *ptr;
38       iptr++;
39       ptr++;
40     }
41
42   /* check results:  */
43   for (i = 0; i < N; i++)
44     {
45       if (res[i] != arr[i]
46           || ires[i].a != iarr[i].b - iarr[i].a
47           || ires[i].b != iarr[i].b +  iarr[i].a)
48         abort ();
49     }
50
51   return 0;
52 }
53
54 int main (void)
55 {
56   int i;
57
58   check_vect ();
59
60   main1 ();
61
62   return 0;
63 }
64
65 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { vect_interleave && vect_extract_even_odd } } } } */
66 /* { dg-final { cleanup-tree-dump "vect" } } */
67