URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 273 |
Rev 519 |
! { dg-do run }
|
! { dg-do run }
|
|
|
integer :: a, b, c
|
integer :: a, b, c
|
a = 1
|
a = 1
|
b = 2
|
b = 2
|
c = 3
|
c = 3
|
call foo
|
call foo
|
if (a .ne. 7) call abort
|
if (a .ne. 7) call abort
|
contains
|
contains
|
subroutine foo
|
subroutine foo
|
use omp_lib
|
use omp_lib
|
logical :: l
|
logical :: l
|
l = .false.
|
l = .false.
|
!$omp parallel shared (a) private (b) firstprivate (c) &
|
!$omp parallel shared (a) private (b) firstprivate (c) &
|
!$omp num_threads (2) reduction (.or.:l)
|
!$omp num_threads (2) reduction (.or.:l)
|
if (a .ne. 1 .or. c .ne. 3) l = .true.
|
if (a .ne. 1 .or. c .ne. 3) l = .true.
|
!$omp barrier
|
!$omp barrier
|
if (omp_get_thread_num () .eq. 0) then
|
if (omp_get_thread_num () .eq. 0) then
|
a = 4
|
a = 4
|
b = 5
|
b = 5
|
c = 6
|
c = 6
|
end if
|
end if
|
!$omp barrier
|
!$omp barrier
|
if (omp_get_thread_num () .eq. 1) then
|
if (omp_get_thread_num () .eq. 1) then
|
if (a .ne. 4 .or. c .ne. 3) l = .true.
|
if (a .ne. 4 .or. c .ne. 3) l = .true.
|
a = 7
|
a = 7
|
b = 8
|
b = 8
|
c = 9
|
c = 9
|
else if (omp_get_num_threads () .eq. 1) then
|
else if (omp_get_num_threads () .eq. 1) then
|
a = 7
|
a = 7
|
end if
|
end if
|
!$omp barrier
|
!$omp barrier
|
if (omp_get_thread_num () .eq. 0) then
|
if (omp_get_thread_num () .eq. 0) then
|
if (a .ne. 7 .or. b .ne. 5 .or. c .ne. 6) l = .true.
|
if (a .ne. 7 .or. b .ne. 5 .or. c .ne. 6) l = .true.
|
end if
|
end if
|
!$omp barrier
|
!$omp barrier
|
if (omp_get_thread_num () .eq. 1) then
|
if (omp_get_thread_num () .eq. 1) then
|
if (a .ne. 7 .or. b .ne. 8 .or. c .ne. 9) l = .true.
|
if (a .ne. 7 .or. b .ne. 8 .or. c .ne. 9) l = .true.
|
end if
|
end if
|
!$omp end parallel
|
!$omp end parallel
|
if (l) call abort
|
if (l) call abort
|
end subroutine foo
|
end subroutine foo
|
end
|
end
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.