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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [libgomp/] [testsuite/] [libgomp.fortran/] [appendix-a/] [a.22.7.f90] - Blame information for rev 867

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

Line No. Rev Author Line
1 38 julius
! { dg-do run }
2
! { dg-require-effective-target tls_runtime }
3
 
4
      PROGRAM A22_7_GOOD
5
        INTEGER, ALLOCATABLE, SAVE :: A(:)
6
        INTEGER, POINTER, SAVE :: PTR
7
        INTEGER, SAVE :: I
8
        INTEGER, TARGET :: TARG
9
        LOGICAL :: FIRSTIN = .TRUE.
10
!$OMP THREADPRIVATE(A, I, PTR)
11
        ALLOCATE (A(3))
12
        A = (/1,2,3/)
13
        PTR => TARG
14
        I=5
15
!$OMP PARALLEL COPYIN(I, PTR)
16
!$OMP CRITICAL
17
            IF (FIRSTIN) THEN
18
              TARG = 4           ! Update target of ptr
19
              I = I + 10
20
              IF (ALLOCATED(A)) A = A + 10
21
              FIRSTIN = .FALSE.
22
            END IF
23
            IF (ALLOCATED(A)) THEN
24
              PRINT *, "a = ", A
25
            ELSE
26
              PRINT *, "A is not allocated"
27
            END IF
28
            PRINT *, "ptr = ", PTR
29
            PRINT *, "i = ", I
30
            PRINT *
31
!$OMP END CRITICAL
32
!$OMP END PARALLEL
33
      END PROGRAM A22_7_GOOD

powered by: WebSVN 2.1.0

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