xref: /llvm-project/flang/test/Semantics/OpenMP/resolve05.f90 (revision 502bea25bdc07d1811b8bfea1c2e6bfa8617f72f)
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp
2
3! 2.15.3 Data-Sharing Attribute Clauses
4! 2.15.3.1 default Clause
5
6subroutine default_none()
7  integer a(3)
8  integer, parameter :: D=10
9  A = 1
10  B = 2
11  !$omp parallel default(none) private(c)
12  !ERROR: The DEFAULT(NONE) clause requires that 'a' must be listed in a data-sharing attribute clause
13  A(1:2) = 3
14  !ERROR: The DEFAULT(NONE) clause requires that 'b' must be listed in a data-sharing attribute clause
15  B = 4
16  C = 5 + D
17  !$omp end parallel
18end subroutine default_none
19
20! Test that indices of sequential loops are privatised and hence do not error
21! for DEFAULT(NONE)
22subroutine default_none_seq_loop
23  integer :: i
24
25  !$omp parallel do default(none)
26  do i = 1, 10
27     do j = 1, 20
28    enddo
29  enddo
30end subroutine
31
32program mm
33  call default_none()
34  call default_none_seq_loop()
35  !TODO: private, firstprivate, shared
36end
37