File: linear-clause01.f90

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,388 kB
  • sloc: cpp: 7,438,767; ansic: 1,393,871; asm: 1,012,926; python: 241,728; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (51 lines) | stat: -rw-r--r-- 2,323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
! REQUIRES: openmp_runtime
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
! OpenMP Version 5.2
! Various checks for the linear clause
! 5.4.6 `linear` Clause

! Case 1
subroutine linear_clause_01(arg)
    integer, intent(in) :: arg(:)
    !ERROR: A modifier may not be specified in a LINEAR clause on the DO directive
    !$omp do linear(uval(arg))
    do i = 1, 5
        print *, arg(i)
    end do
end subroutine linear_clause_01

! Case 2
subroutine linear_clause_02(arg_01, arg_02)
    !ERROR: The list item 'arg_01' specified without the REF 'linear-modifier' must be of INTEGER type
    !$omp declare simd linear(val(arg_01))
    real, intent(in) :: arg_01(:)

    !ERROR: The list item 'arg_02' specified without the REF 'linear-modifier' must be of INTEGER type
    !ERROR: If the `linear-modifier` is REF or UVAL, the list item 'arg_02' must be a dummy argument without the VALUE attribute
    !$omp declare simd linear(uval(arg_02))
    !ERROR: The type of 'arg_02' has already been implicitly declared
    integer, value, intent(in) :: arg_02

    !ERROR: The list item 'var' specified without the REF 'linear-modifier' must be of INTEGER type
    !ERROR: If the `linear-modifier` is REF or UVAL, the list item 'var' must be a dummy argument without the VALUE attribute
    !ERROR: The list item `var` must be a dummy argument
    !ERROR: The list item `var` in a LINEAR clause must not be Cray Pointer or a variable with POINTER attribute
    !$omp declare simd linear(uval(var))
    !ERROR: The type of 'var' has already been implicitly declared
    integer, pointer :: var
end subroutine linear_clause_02

! Case 3
subroutine linear_clause_03(arg)
    integer, intent(in) :: arg
    !ERROR: The list item `arg` specified with the REF 'linear-modifier' must be polymorphic variable, assumed-shape array, or a variable with the `ALLOCATABLE` attribute
    !ERROR: List item 'arg' present at multiple LINEAR clauses
    !ERROR: 'arg' appears in more than one data-sharing clause on the same OpenMP directive
    !$omp declare simd linear(ref(arg)) linear(arg)

    integer :: i
    common /cc/ i
    !ERROR: The list item `i` must be a dummy argument
    !ERROR: 'i' is a common block name and must not appear in an LINEAR clause
    !$omp declare simd linear(i)
end subroutine linear_clause_03