1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-require-effective-target vect_condition } */
4 
5 #define N 16
6 
7 typedef struct {
8   int x;
9   int y;
10 } Point;
11 
12 void
foo(Point * p1,Point * p2,Point * p3,int * data)13 foo(Point *p1, Point *p2, Point *p3, int *data)
14 {
15   int m, m1, m2;
16   int i;
17 
18   for (i = 0; i < N; i++) {
19     m = *data++;
20 
21     m1 = p1->x - m;
22     m2 = p2->x + m;
23 
24     p3->y = (m1 >= m2) ? p1->y : p2->y;
25 
26     p1++;
27     p2++;
28     p3++;
29   }
30 }
31 
32 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
33