-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! Check OpenMP Allocate directive
use omp_lib
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! The allocate directive must appear in the same scope as the declarations of
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! At most one allocator clause can appear on the allocate directive.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! A variable that is part of another variable (as an array or
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! Only the allocator clause is allowed on the allocate directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! allocate directives that appear in a target region must specify an allocator
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! List items specified in the allocate directive must not have the ALLOCATABLE attribute unless the directive is associated with an
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! A type parameter inquiry cannot appear in an allocate directive.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! If list items within the ALLOCATE directive have the SAVE attribute, are a common block name, or are declared in the scope of a
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
use omp_lib
! Check OpenMP 2.13.6 atomic Construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! Semantic checks for OpenMP 5.0 standard 2.17.7 atomic Construct.
use omp_lib
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Atomic construct
! section 2.17.7
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Atomic construct
! section 2.17.7
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Atomic construct
! section 2.17.7
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! This tests the various semantics related to the clauses of various OpenMP atomic constructs
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
use omp_lib
! Check OpenMP clause validity for the following directives:
!
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
program main
implicit none
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.4.1 copyin Clause
! A list item that appears in a copyin clause must be threadprivate
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.4.1 copyin Clause
! A common block name that appears in a copyin clause must be declared to be
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.4.1 copyin Clause
! A list item that appears in a copyin clause must be threadprivate.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.4.1 copyin Clause
! A list item that appears in a copyin clause must be threadprivate
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.4.1 copyin Clause
! A common block name that appears in a copyin clause must be declared to be
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.4.2 copyprivate Clause
! A list item that appears in a copyprivate clause may not appear in a
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.4.2 copyprivate Clause
! Pointers with the INTENT(IN) attribute may not appear in a copyprivate clause.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.4.2 copyprivate Clause
! All list items that appear in the copyprivate clause must be either
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Check OpenMP declarative directives
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.14.7 Declare Target Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.14.7 Declare Target Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.14.7 Declare Target Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.14.7 Declare Target Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.14.7 Declare Target Directive
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.1 default Clause
program omp_default
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.1 default Clause - a positive test case.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.13.9 Depend Clause
! List items used in depend clauses cannot be zero-length array sections.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.13.9 Depend Clause
! A variable that is part of another variable
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.13.9 Depend Clause
! Coarrays are not supported in depend clause
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Check OpenMP clause validity for the following directives:
! 2.10 Device constructs
program main
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Collapse Clause Positive cases
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Collapse Clause
program omp_doCollapse
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! Check for cycle statements leaving an OpenMP structured block
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Ordered Clause positive cases.
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Ordered Clause
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Schedule Clause
program omp_doSchedule
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Schedule Clause
program omp_doSchedule
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Schedule Clause
! Test that does not catch non constant integer expressions like xx - xx.
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Schedule Clause
! Test that does not catch non constant integer expressions like xx - yy.
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The loop iteration variable may not appear in a firstprivate directive.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The loop iteration variable may not appear in a firstprivate directive.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Do Loop Constructs
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The loop iteration variable may not appear in a threadprivate directive.
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct restrictions on single directive.
! A positive case
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct restrictions on single directive.
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The ordered clause must be present on the loop construct if any ordered
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The ordered clause must be present on the loop construct if any ordered
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The do-loop cannot be a DO WHILE or a DO loop without loop control.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The DO loop iteration variable must be of type integer.
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Do Loop Constructs
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Do Loop constructs.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Do Loop constructs.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Do Loop constructs.
--- /dev/null
+! RUN: %flang_fc1 -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
+! RUN: %flang_fc1 -fopenmp -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
+! CHECK-NOT: do *[1-9]
+
+program P
+implicit none
+integer OMP_GET_NUM_THREADS, OMP_GET_THREAD_NUM
+integer NUMTHRDS, TID
+integer N, CSZ, CNUM, I
+parameter (N=100)
+parameter (CSZ=10)
+real A(N), B(N), C(N)
+
+do 10 I = 1, N
+ A(I) = I * 1.0
+10 continue
+
+B = A
+CNUM = CSZ
+
+!$OMP PARALLEL SHARED(A,B,C,NUMTHRDS,CNUM) PRIVATE(I,TID)
+TID = OMP_GET_THREAD_NUM()
+if (TID .EQ. 0) then
+ NUMTHRDS = OMP_GET_NUM_THREADS()
+ print *, "Number of threads =", NUMTHRDS
+end if
+print *, "Thread", TID, " is starting..."
+
+!$OMP DO SCHEDULE(DYNAMIC,CNUM)
+do 20 I = 1, N
+ C(I) = A(I) + B(I)
+ write (*,100) TID, I, C(I)
+20 continue
+!$OMP END DO NOWAIT
+
+print *, "Thread", TID, " done."
+
+!$OMP END PARALLEL
+100 format(" Thread", I2, ": C(", I3, ")=", F8.2)
+end program P
--- /dev/null
+! RUN: %flang_fc1 -fopenmp -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
+! CHECK-NOT: do *[1-9]
+! CHECK: omp simd
+
+program P
+implicit none
+integer N, I
+parameter (N=100)
+real A(N), B(N), C(N)
+
+!$OMP SIMD
+do 10 I = 1, N
+ A(I) = I * 1.0
+10 continue
+
+B = A
+
+!$OMP SIMD
+do 20 I = 1, N
+ C(I) = A(I) + B(I)
+ write (*,100) I, C(I)
+20 continue
+
+100 format(" C(", I3, ")=", F8.2)
+end program P
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.4 firstprivate Clause
! Variables that appear in a firstprivate clause on a distribute or
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! 2.17.8 Flush construct [OpenMP 5.0]
! memory-order-clause ->
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! Check OpenMP 5.0 - 2.17.8 flush Construct
! Restriction -
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.5 lastprivate Clause
! A variable that appears in a lastprivate clause must be definable.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.5 lastprivate Clause
! A list item that is private within a parallel region, or that appears in
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! Various checks with the ordered construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Check the association between OpenMPLoopConstruct and DoConstruct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.8.3 Loop simd Construct
--- /dev/null
+! RUN: %python %S/../test_modfile.py %s %flang_fc1 -fopenmp
+! Check correct modfile generation for OpenMP threadprivate directive.
+
+module m
+ implicit none
+ type :: my_type(kind_param, len_param)
+ integer, KIND :: kind_param
+ integer, LEN :: len_param
+ integer :: t_i
+ integer :: t_arr(10)
+ end type
+ type(my_type(kind_param=2, len_param=4)) :: t
+ real, dimension(3) :: thrtest
+ real :: x
+ common /blk/ x
+
+ !$omp threadprivate(thrtest, t, /blk/)
+end
+
+!Expect: m.mod
+!module m
+!type::my_type(kind_param,len_param)
+!integer(4),kind::kind_param
+!integer(4),len::len_param
+!integer(4)::t_i
+!integer(4)::t_arr(1_8:10_8)
+!end type
+!type(my_type(kind_param=2_4,len_param=4_4))::t
+!!$omp threadprivate(t)
+!real(4)::thrtest(1_8:3_8)
+!!$omp threadprivate(thrtest)
+!real(4)::x
+!!$omp threadprivate(x)
+!common/blk/x
+!end
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! Various checks with the nesting of BARRIER construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Check OpenMP clause validity for the following directives:
! 2.10 Device constructs
program main
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! Various checks with the nesting of MASTER construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! Various checks with the nesting of SIMD construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Check OpenMP 2.17 Nesting of Regions
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
subroutine bug48308(x,i)
real :: x(:)
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! REQUIRES: shell
! Check OpenMP clause validity for NONTEMPORAL clause
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! Various checks with the ordered construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.19.9 Ordered Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.19.9 Ordered Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.19.9 Ordered Construct
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 parallel private Clause
program omp_parallel_private
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 parallel private Clause
program omp_parallel_private
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 parallel private Clause
program omp_parallel_private
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 parallel private Clause
program omp_parallel_private
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP version 5.0.0
! 2.13.3 parallel sections Construct
! The restrictions for the parallel construct and the sections construct apply
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.2 parallel shared Clause
program omp_parallel_shared
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.2 parallel shared Clause
program omp_parallel_shared
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.2 parallel shared Clause
program omp_parallel_shared
-!RUN: %python %S/test_errors.py %s %flang -fopenmp
+!RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.2 parallel shared Clause
program omp_parallel_shared
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 private Clause
! Pointers with the INTENT(IN) attribute may not appear in a private clause.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.3 private Clause
! Variables that appear in namelist statements may not appear in a private clause.
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
program omp_reduction
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
program omp_reduction
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
program omp_Reduction
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
program omp_reduction
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause Positive cases
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause Positive cases.
!DEF: /omp_reduction MainProgram
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.15.3.6 Reduction Clause
program omp_reduction
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! 2.4 An array section designates a subset of the elements in an array. Although
! Substring shares similar syntax but cannot be treated as valid array section.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! Test the effect to name resolution from illegal clause
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! 2.15.3 Although variables in common blocks can be accessed by use association
! or host association, common block names cannot. As a result, a common block
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! A list item that specifies a given variable may not appear in more than
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! 2.15.3.1 default Clause
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
use omp_lib
!2.11.4 Allocate Clause
!For any list item that is specified in the allocate
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.2 sections Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP version 5.0.0
! 2.8.1 sections construct
! The code enclosed in a sections construct must be a structured block.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
!XFAIL: *
! OpenMP version 5.0.0
! 2.8.1 sections construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.8.1 simd Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.8.1 simd Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! 2.9.3.1 simd Construct
! - A program that branches into or out of a simd region is non-conforming.
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.8.1 simd Construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.3 single Construct
! Symbol present on multiple clauses
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.3 single Construct
! Copyprivate variable is not thread private or private in outer context
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! Test clauses that accept list.
! 2.1 Directive Format
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 1.4.1 Structure of the OpenMP Memory Model
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 1.4.1 Structure of the OpenMP Memory Model
! In the inner OpenMP region, SHARED `a` refers to the `a` in the outer OpenMP
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! Both PARALLEL and DO (worksharing) directives need to create new scope,
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 2.15.2 threadprivate Directive
! The threadprivate directive specifies that variables are replicated,
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! A list item that specifies a given variable may not appear in more than
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! Generic tests
! 1. subroutine or function calls should not be fixed for DSA or DMA
-! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
! 2.15.1.1 Predetermined rules for associated do-loops index variable
! a) The loop iteration variable(s) in the associated do-loop(s) of a do,
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! 2.17.1 critical construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! 2.17.1 critical construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
use omp_lib
implicit none
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! 2.10.3 taskloop simd Construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.9.2 taskloop Construct
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.21.2 Threadprivate Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.21.2 Threadprivate Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.21.2 Threadprivate Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.21.2 Threadprivate Directive
-! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 5.1
! Check OpenMP construct validity for the following directives:
! 2.21.2 Threadprivate Directive
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.4 workshare Construct
! Invalid do construct inside !$omp workshare
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.4 workshare Construct
! The !omp workshare construct must not contain any user defined
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.4 workshare Construct
! All array assignments, scalar assignments, and masked array assignments
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.4 workshare Construct
! Checks for OpenMP Workshare construct
-! RUN: %python %S/test_errors.py %s %flang -fopenmp
+! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 4.5
! 2.7.4 workshare Construct
! Checks for OpenMP Parallel constructs enclosed in Workshare constructs
-! RUN: %flang_fc1 -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
-! RUN: %flang_fc1 -fopenmp -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
-! CHECK-NOT: do *[1-9]
+! Check that if there is a label or a name on an label-do-stmt,
+! then it is not lost when rewriting it to an non-label-do-stmt.
-program P
-implicit none
-integer OMP_GET_NUM_THREADS, OMP_GET_THREAD_NUM
-integer NUMTHRDS, TID
-integer N, CSZ, CNUM, I
-parameter (N=100)
-parameter (CSZ=10)
-real A(N), B(N), C(N)
+! RUN: %flang_fc1 -fdebug-unparse-with-symbols -pedantic %s 2>&1 | FileCheck %s
-do 10 I = 1, N
- A(I) = I * 1.0
-10 continue
+! CHECK: end do
+! CHECK: 2 do
+! CHECK: mainloop: do
+! CHECK: end do mainloop
-B = A
-CNUM = CSZ
+! CHECK-NOT: do [1-9]
-!$OMP PARALLEL SHARED(A,B,C,NUMTHRDS,CNUM) PRIVATE(I,TID)
-TID = OMP_GET_THREAD_NUM()
-if (TID .EQ. 0) then
- NUMTHRDS = OMP_GET_NUM_THREADS()
- print *, "Number of threads =", NUMTHRDS
-end if
-print *, "Thread", TID, " is starting..."
+subroutine foo()
+ do 1 i=1,2
+ goto 2
+1 continue
+2 do 3 i=1,2
+3 continue
-!$OMP DO SCHEDULE(DYNAMIC,CNUM)
-do 20 I = 1, N
- C(I) = A(I) + B(I)
- write (*,100) TID, I, C(I)
-20 continue
-!$OMP END DO NOWAIT
-
-print *, "Thread", TID, " done."
-
-!$OMP END PARALLEL
-100 format(" Thread", I2, ": C(", I3, ")=", F8.2)
-end program P
+ mainloop : do 4 i=1,100
+ do j=1,20
+ if (j==i) then
+ ! cycle mainloop: TODO: fix invalid complaints that mainloop construct
+ ! is not in scope.
+ end if
+ end do
+4 end do mainloop
+end subroutine
-! RUN: %flang_fc1 -fopenmp -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
-! CHECK-NOT: do *[1-9]
-! CHECK: omp simd
+! Error test -- DO loop uses obsolete loop termination statement (warning)
+! See R1131 and C1133
-program P
-implicit none
-integer N, I
-parameter (N=100)
-real A(N), B(N), C(N)
+! By default, this is not an error and label do are rewritten to non-label do.
+! A warning is generated with -pedantic
-!$OMP SIMD
-do 10 I = 1, N
- A(I) = I * 1.0
-10 continue
+! RUN: %flang_fc1 -fdebug-unparse-with-symbols -pedantic %s 2>%t.stderr | FileCheck %s
-B = A
+! CHECK: end do
-!$OMP SIMD
-do 20 I = 1, N
- C(I) = A(I) + B(I)
- write (*,100) I, C(I)
-20 continue
+! The following CHECK-NOT actively uses the fact that the leading zero of labels
+! would be removed in the unparse but not the line linked to warnings. We do
+! not want to see label do in the unparse only.
+! CHECK-NOT: do [1-9]
-100 format(" C(", I3, ")=", F8.2)
-end program P
+! RUN: FileCheck --check-prefix=ERR --input-file=%t.stderr %s
+! ERR: A DO loop should terminate with an END DO or CONTINUE
+
+subroutine foo10()
+ real :: a(10, 10), b(10, 10) = 1.0
+ do 01 k=1,4
+ where (a<k)
+ a = a + b
+ b = a - b
+ elsewhere
+ a = a*2
+01 end where
+end subroutine
+++ /dev/null
-! Error test -- DO loop uses obsolete loop termination statement (warning)
-! See R1131 and C1133
-
-! By default, this is not an error and label do are rewritten to non-label do.
-! A warning is generated with -pedantic
-
-! RUN: %flang_fc1 -fdebug-unparse-with-symbols -pedantic %s 2>%t.stderr | FileCheck %s
-
-! CHECK: end do
-
-! The following CHECK-NOT actively uses the fact that the leading zero of labels
-! would be removed in the unparse but not the line linked to warnings. We do
-! not want to see label do in the unparse only.
-! CHECK-NOT: do [1-9]
-
-! RUN: FileCheck --check-prefix=ERR --input-file=%t.stderr %s
-! ERR: A DO loop should terminate with an END DO or CONTINUE
-
-subroutine foo10()
- real :: a(10, 10), b(10, 10) = 1.0
- do 01 k=1,4
- where (a<k)
- a = a + b
- b = a - b
- elsewhere
- a = a*2
-01 end where
-end subroutine
+++ /dev/null
-! Check that if there is a label or a name on an label-do-stmt,
-! then it is not lost when rewriting it to an non-label-do-stmt.
-
-! RUN: %flang_fc1 -fdebug-unparse-with-symbols -pedantic %s 2>&1 | FileCheck %s
-
-! CHECK: end do
-! CHECK: 2 do
-! CHECK: mainloop: do
-! CHECK: end do mainloop
-
-! CHECK-NOT: do [1-9]
-
-subroutine foo()
- do 1 i=1,2
- goto 2
-1 continue
-2 do 3 i=1,2
-3 continue
-
- mainloop : do 4 i=1,100
- do j=1,20
- if (j==i) then
- ! cycle mainloop: TODO: fix invalid complaints that mainloop construct
- ! is not in scope.
- end if
- end do
-4 end do mainloop
-end subroutine
-! RUN: %python %S/test_modfile.py %s %flang_fc1 -fopenmp
-! Check correct modfile generation for OpenMP threadprivate directive.
-
-module m
- implicit none
- type :: my_type(kind_param, len_param)
- integer, KIND :: kind_param
- integer, LEN :: len_param
- integer :: t_i
- integer :: t_arr(10)
- end type
- type(my_type(kind_param=2, len_param=4)) :: t
- real, dimension(3) :: thrtest
- real :: x
- common /blk/ x
-
- !$omp threadprivate(thrtest, t, /blk/)
+! RUN: %python %S/test_errors.py %s %flang_fc1
+subroutine foo
+end
+subroutine iso_fortran_env
+end
+subroutine bad1
+ !ERROR: 'foo' is not a module
+ use foo
+end
+subroutine ok1
+ use, intrinsic :: iso_fortran_env
+end
+subroutine ok2
+ use iso_fortran_env
+end
+subroutine bad2
+ !ERROR: 'iso_fortran_env' is not a module
+ use, non_intrinsic :: iso_fortran_env
end
-
-!Expect: m.mod
-!module m
-!type::my_type(kind_param,len_param)
-!integer(4),kind::kind_param
-!integer(4),len::len_param
-!integer(4)::t_i
-!integer(4)::t_arr(1_8:10_8)
-!end type
-!type(my_type(kind_param=2_4,len_param=4_4))::t
-!!$omp threadprivate(t)
-!real(4)::thrtest(1_8:3_8)
-!!$omp threadprivate(thrtest)
-!real(4)::x
-!!$omp threadprivate(x)
-!common/blk/x
-!end
+++ /dev/null
-! RUN: %python %S/test_errors.py %s %flang_fc1
-subroutine foo
-end
-subroutine iso_fortran_env
-end
-subroutine bad1
- !ERROR: 'foo' is not a module
- use foo
-end
-subroutine ok1
- use, intrinsic :: iso_fortran_env
-end
-subroutine ok2
- use iso_fortran_env
-end
-subroutine bad2
- !ERROR: 'iso_fortran_env' is not a module
- use, non_intrinsic :: iso_fortran_env
-end