1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops2-details -fdump-tree-optimized" } */
10 unsigned char ub
[N
] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 unsigned char uc
[N
] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
13 __attribute__ ((noinline
)) void
14 main1 (unsigned char x
, unsigned char max_result
, unsigned char min_result
)
17 unsigned char udiff
= 2;
18 unsigned char umax
= x
;
19 unsigned char umin
= x
;
21 for (i
= 0; i
< N
; i
++) {
22 udiff
+= (unsigned char)(ub
[i
] - uc
[i
]);
25 for (i
= 0; i
< N
; i
++) {
26 umax
= umax
< uc
[i
] ? uc
[i
] : umax
;
29 for (i
= 0; i
< N
; i
++) {
30 umin
= umin
> uc
[i
] ? uc
[i
] : umin
;
36 if (umax
!= max_result
)
38 if (umin
!= min_result
)
42 __attribute__((noinline
))
63 /* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops2" } } */
64 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 4 "parloops2" } } */