1 /* { dg-require-effective-target vect_double } */
3 /* need -funsafe-math-optimizations to vectorize the summation.
4 also need -ffinite-math-only to create the min/max expr. */
12 double b
[N
] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13 double c
[N
] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
15 int main1 (double x
, double max_result
)
22 for (i
= 0; i
< N
; i
++) {
23 diff
+= (b
[i
] - c
[i
]);
26 for (i
= 0; i
< N
; i
++) {
27 max
= max
< c
[i
] ? c
[i
] : max
;
30 for (i
= 0; i
< N
; i
++) {
31 min
= min
> c
[i
] ? c
[i
] : min
;
37 if (max
!= max_result
)
54 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */