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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [libgomp/] [testsuite/] [libgomp.fortran/] [omp_atomic2.f90] - Diff between revs 273 and 519

Only display areas with differences | Details | Blame | View Log

Rev 273 Rev 519
! { dg-do run }
! { dg-do run }
  real, dimension (20) :: r
  real, dimension (20) :: r
  integer, dimension (20) :: d
  integer, dimension (20) :: d
  integer :: i, j, k, n
  integer :: i, j, k, n
  integer (kind = 2) :: a, b, c
  integer (kind = 2) :: a, b, c
  do 10 i = 1, 20
  do 10 i = 1, 20
    r(i) = i
    r(i) = i
10  d(i) = 21 - i
10  d(i) = 21 - i
  n = 20
  n = 20
  call foo (r, d, n)
  call foo (r, d, n)
  if (n .ne. 22) call abort
  if (n .ne. 22) call abort
  if (any (r .ne. 33)) call abort
  if (any (r .ne. 33)) call abort
  i = 1
  i = 1
  j = 18
  j = 18
  k = 23
  k = 23
!$omp atomic
!$omp atomic
  i = min (i, j, k, n)
  i = min (i, j, k, n)
  if (i .ne. 1) call abort
  if (i .ne. 1) call abort
!$omp atomic
!$omp atomic
  i = max (j, n, k, i)
  i = max (j, n, k, i)
  if (i .ne. 23) call abort
  if (i .ne. 23) call abort
  a = 1
  a = 1
  b = 18
  b = 18
  c = 23
  c = 23
!$omp atomic
!$omp atomic
  a = min (a, b, c)
  a = min (a, b, c)
  if (a .ne. 1) call abort
  if (a .ne. 1) call abort
!$omp atomic
!$omp atomic
  a = max (a, b, c)
  a = max (a, b, c)
  if (a .ne. 23) call abort
  if (a .ne. 23) call abort
contains
contains
  function bar (i)
  function bar (i)
    real bar
    real bar
    integer i
    integer i
    bar = 12.0 + i
    bar = 12.0 + i
  end function bar
  end function bar
  subroutine foo (x, y, n)
  subroutine foo (x, y, n)
    integer i, y (*), n
    integer i, y (*), n
    real x (*)
    real x (*)
    do i = 1, n
    do i = 1, n
!$omp atomic
!$omp atomic
      x(y(i)) = x(y(i)) + bar (i)
      x(y(i)) = x(y(i)) + bar (i)
    end do
    end do
!$omp atomic
!$omp atomic
    n = n + 2
    n = n + 2
  end subroutine foo
  end subroutine foo
end
end
 
 

powered by: WebSVN 2.1.0

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