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