2 ! { dg-options "-ffrontend-optimize -fdump-tree-original -fopenmp" }
3 ! Test that common function elimination is done within the OMP parallel
4 ! blocks even if there is a workshare around it.
7 integer, parameter :: n
= 10000000
8 real, parameter :: eps
= 3e-7
10 real :: A(n
), B(5), C(n
)
17 !$omp parallel workshare
18 !$omp parallel default(shared)
21 A(j
) = A(j
)*cos(B(1))+A(j
)*cos(B(1))
25 !$omp end parallel workshare
28 c
= c
*cos(b(1))+ c
*cos(b(1))
31 if (abs(a(j
)-c(j
)) > eps
) then
32 print *,1,j
,a(j
), c(j
)
38 ! { dg-final { scan-tree-dump-times "__builtin_cosf" 2 "original" } }
39 ! { dg-final { cleanup-tree-dump "original" } }