File: declarative-directive02.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 (56 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download | duplicates (4)
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
52
53
54
55
56
! RUN: %flang -fsyntax-only -fopenmp %s 2>&1

! Check that OpenMP declarative directives can be used with objects that have
! an incomplete type.

subroutine test_decl
  ! OMPv5.2 5.2 threadprivate
  ! OMPv5.2 6.5 allocate
  implicit none
  save :: x1, y1
  !$omp threadprivate(x1)
  !$omp allocate(y1)
  integer :: x1, y1

  ! OMPv5.2 7.7 declare-simd
  external :: simd_func
  !$omp declare simd(simd_func)
  logical :: simd_func

  ! OMPv5.2 7.8.1 declare-target
  allocatable :: j
  !$omp declare target(j)
  save :: j
  real(kind=8) :: j(:)

  ! OMPv5.2 5.5.11 declare-reduction - crashes
  !external :: my_add_red
  !!$omp declare reduction(my_add_red : integer : my_add_red(omp_out, omp_in)) &
  !!$omp&  initializer(omp_priv=0)
  !integer :: my_add_red
end subroutine

subroutine test_decl2
  save x1, y1
  !$omp threadprivate(x1)
  !$omp allocate(y1)
  integer :: x1, y1

  ! implicit decl
  !$omp threadprivate(x2)
  !$omp allocate(y2)
  save x2, y2
end subroutine

module m1
  ! implicit decl
  !$omp threadprivate(x, y, z)
  integer :: y
  real :: z

contains
  subroutine sub
    !$omp parallel copyin(x, y, z)
    !$omp end parallel
  end subroutine
end module