1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-final_cleanup" } */
10 __attribute__ ((noinline))
11 int main1 (float x, float max_result)
14 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
15 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
20 for (i = 0; i < N; i++) {
21 diff += (b[i] - c[i]);
24 for (i = 0; i < N; i++) {
25 max = max < c[i] ? c[i] : max;
28 for (i = 0; i < N; i++) {
29 min = min > c[i] ? c[i] : min;
35 if (max != max_result)
50 /* need -ffast-math to parallelize these loops. */
51 /* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops" } } */
52 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
53 /* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */
54 /* { dg-final { cleanup-tree-dump "parloops" } } */
55 /* { dg-final { cleanup-tree-dump "final_cleanup" } } */