OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [gomp/] [workshare3.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
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.
5
program foo
6
  implicit none
7
  integer, parameter :: n = 10000000
8
  real, parameter :: eps = 3e-7
9
  integer :: i,j
10
  real :: A(n), B(5), C(n)
11
  real :: tmp
12
  B(1) = 3.344
13
  tmp = B(1)
14
  do i=1,10
15
     call random_number(a)
16
     c = a
17
     !$omp parallel workshare
18
     !$omp parallel default(shared)
19
     !$omp do
20
     do j=1,n
21
       A(j) = A(j)*cos(B(1))+A(j)*cos(B(1))
22
     end do
23
     !$omp end do
24
     !$omp end parallel
25
     !$omp end parallel workshare
26
  end do
27
 
28
  c = c*cos(b(1))+ c*cos(b(1))
29
 
30
  do j=1,n
31
     if (abs(a(j)-c(j)) > eps) then
32
        print *,1,j,a(j), c(j)
33
        call abort
34
     end if
35
  end do
36
 
37
end program foo
38
! { dg-final { scan-tree-dump-times "__builtin_cosf" 2 "original" } }
39
! { dg-final { cleanup-tree-dump "original" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.