Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90

raw
1 ! { dg-do compile }
2 ! { dg-require-effective-target tls }
3
4 SUBROUTINE A24(A)
5 INTEGER A
6 INTEGER X, Y, Z(1000)
7 INTEGER OMP_GET_NUM_THREADS
8 COMMON/BLOCKX/X
9 COMMON/BLOCKY/Y
10 COMMON/BLOCKZ/Z
11 !$OMP THREADPRIVATE(/BLOCKX/)
12 INTEGER I, J
13 i=1
14 !$OMP PARALLEL DEFAULT(NONE) PRIVATE(A) SHARED(Z) PRIVATE(J) ! { dg-line omp_parallel }
15 J = OMP_GET_NUM_THREADS();
16 ! O.K. - J is listed in PRIVATE clause
17 A = Z(J) ! O.K. - A is listed in PRIVATE clause
18 ! - Z is listed in SHARED clause
19 X=1 ! O.K. - X is THREADPRIVATE
20 Z(I) = Y ! Error - cannot reference I or Y here
21 ! { dg-error "'i' not specified" "" { target *-*-* } .-1 } */
22 ! { dg-message "note: enclosing 'parallel'" "" { target *-*-* } omp_parallel } */
23 ! { dg-error "'y' not specified" "" { target *-*-* } .-3 } */
24 !$OMP DO firstprivate(y)
25 DO I = 1,10
26 Z(I) = Y ! O.K. - I is the loop iteration variable
27 ! Y is listed in FIRSTPRIVATE clause
28 END DO
29 Z(I) = Y ! Error - cannot reference I or Y here
30 !$OMP END PARALLEL
31 END SUBROUTINE A24