1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops2-details -fdump-tree-optimized" } */
11 __attribute__ ((noinline
))
12 int main1 (float x
, float max_result
)
27 for (i
= 0; i
< N
; i
++) {
28 diff
+= (b
[i
] - c
[i
]);
31 for (i
= 0; i
< N
; i
++) {
32 max
= max
< c
[i
] ? c
[i
] : max
;
35 for (i
= 0; i
< N
; i
++) {
36 min
= min
> c
[i
] ? c
[i
] : min
;
42 if (max
!= max_result
)
58 /* need -ffast-math to parallelize these loops. */
59 /* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops2" } } */
60 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops2" } } */
61 /* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops2" } } */