48 lines · plain
1! REQUIRES: openmp_runtime2! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags3! OpenMP Version 5.24! Various checks for the linear clause5! 5.4.6 `linear` Clause6 7! Case 18subroutine linear_clause_01(arg)9 integer, intent(in) :: arg(:)10 !ERROR: A modifier may not be specified in a LINEAR clause on the DO directive11 !$omp do linear(uval(arg))12 do i = 1, 513 print *, arg(i)14 end do15end subroutine linear_clause_0116 17! Case 218subroutine linear_clause_02(arg_01, arg_02)19 !ERROR: The list item 'arg_01' specified without the REF 'linear-modifier' must be of INTEGER type20 !$omp declare simd linear(val(arg_01))21 real, intent(in) :: arg_01(:)22 23 !ERROR: If the `linear-modifier` is REF or UVAL, the list item 'arg_02' must be a dummy argument without the VALUE attribute24 !$omp declare simd linear(uval(arg_02))25 integer, value, intent(in) :: arg_0226 27 !ERROR: If the `linear-modifier` is REF or UVAL, the list item 'var' must be a dummy argument without the VALUE attribute28 !ERROR: The list item `var` must be a dummy argument29 !ERROR: The list item `var` in a LINEAR clause must not be Cray Pointer or a variable with POINTER attribute30 !$omp declare simd linear(uval(var))31 integer, pointer :: var32end subroutine linear_clause_0233 34! Case 335subroutine linear_clause_03(arg)36 integer, intent(in) :: arg37 !ERROR: The list item `arg` specified with the REF 'linear-modifier' must be polymorphic variable, assumed-shape array, or a variable with the `ALLOCATABLE` attribute38 !ERROR: List item 'arg' present at multiple LINEAR clauses39 !ERROR: 'arg' appears in more than one data-sharing clause on the same OpenMP directive40 !$omp declare simd linear(ref(arg)) linear(arg)41 42 integer :: i43 common /cc/ i44 !ERROR: The list item `i` must be a dummy argument45 !ERROR: 'i' is a common block name and must not appear in an LINEAR clause46 !$omp declare simd linear(i)47end subroutine linear_clause_0348