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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s
! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
program main
!CHECK-LABEL: program main
implicit none
integer, parameter :: N = 256
type data01
integer :: a
integer :: arr(N)
end type
real :: arrA(N), arrB(N)
integer, target :: arrC(N)
type(data01) :: data01_a
integer, allocatable :: alloc_arr(:)
integer, pointer :: ptrArr(:)
arrA = 1.414
arrB = 3.14
arrC = -1
data01_a%a = -1
data01_arr = -1
allocate(alloc_arr(N))
alloc_arr = -1
!CHECK: !$omp target defaultmap(tofrom:scalar)
!$omp target defaultmap(tofrom:scalar)
do i = 1, N
a = 3.14
enddo
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Tofrom
!PARSE-TREE: VariableCategory = Scalar
!CHECK: !$omp target defaultmap(alloc:scalar)
!$omp target defaultmap(alloc:scalar)
a = 4.56
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Alloc
!PARSE-TREE: VariableCategory = Scalar
!CHECK: !$omp target defaultmap(none)
!$omp target defaultmap(none)
a = 6.78
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = None
!CHECK: !$omp target defaultmap(none:scalar)
!$omp target defaultmap(none:scalar)
a = 4.78
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = None
!PARSE-TREE: VariableCategory = Scalar
!CHECK: !$omp target defaultmap(to:scalar)
!$omp target defaultmap(to:scalar)
a = 2.39
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = To
!PARSE-TREE: VariableCategory = Scalar
!CHECK: !$omp target defaultmap(firstprivate:scalar)
!$omp target defaultmap(firstprivate:scalar)
a = 9.45
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Firstprivate
!PARSE-TREE: VariableCategory = Scalar
!CHECK: !$omp target defaultmap(tofrom:aggregate)
!$omp target defaultmap(tofrom:aggregate)
arrC(1) = 10
data01_a%a = 11
data01_a%arr(1) = 100
data01_a%arr(2) = 245
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Tofrom
!PARSE-TREE: VariableCategory = Aggregate
!CHECK: !$omp target defaultmap(tofrom:allocatable)
!$omp target defaultmap(tofrom:allocatable)
alloc_arr(23) = 234
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Tofrom
!PARSE-TREE: VariableCategory = Allocatable
!CHECK: !$omp target defaultmap(default:pointer)
!$omp target defaultmap(default:pointer)
ptrArr=>arrC
ptrArr(2) = 5
prtArr(200) = 34
!CHECK: !$omp end target
!$omp end target
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE: ImplicitBehavior = Default
!PARSE-TREE: VariableCategory = Pointer
end program main
!CHECK-LABEL: end program main
|