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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [pr42162.f90] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
! PR fortran/42162
2
! { dg-do run }
3
 
4
subroutine sub1(k, a)
5
  implicit none
6
  integer :: k, a(3)
7
  !$omp do
8
    do k=1,3
9
      a(k) = a(k) + 1
10
    enddo
11
  !$omp end do
12
end subroutine sub1
13
 
14
subroutine sub2(k, a)
15
  implicit none
16
  integer :: k, a(3)
17
  !$omp do private (k)
18
    do k=1,3
19
      a(k) = a(k) + 1
20
    enddo
21
  !$omp end do
22
end subroutine sub2
23
 
24
subroutine sub3(k, a)
25
  implicit none
26
  integer :: k, a(3)
27
  !$omp do lastprivate (k)
28
    do k=1,3
29
      a(k) = a(k) + 1
30
    enddo
31
  !$omp end do
32
end subroutine sub3
33
 
34
program pr42162
35
  implicit none
36
  integer :: k, a(3), b(3), c(3)
37
  a = 1
38
  b = 2
39
  c = 3
40
  k = 3
41
  !$omp parallel num_threads(3)
42
  call sub1 (k, a)
43
  !$omp end parallel
44
  k = 4
45
  !$omp parallel num_threads(3)
46
  call sub2 (k, b)
47
  !$omp end parallel
48
  k = 10
49
  !$omp parallel num_threads(3)
50
  call sub3 (k, c)
51
  !$omp end parallel
52
  if (k.ne.4.or.any(a.ne.2).or.any(b.ne.3).or.any(c.ne.4)) call abort
53
end

powered by: WebSVN 2.1.0

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