1 ! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s
2 ! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
4 !CHECK-LABEL: program main
7 integer, parameter :: N
= 256
14 real :: arrA(N
), arrB(N
)
15 integer, target
:: arrC(N
)
16 type(data01
) :: data01_a
17 integer, allocatable
:: alloc_arr(:)
18 integer, pointer :: ptrArr(:)
25 allocate(alloc_arr(N
))
29 !CHECK: !$omp target defaultmap(tofrom:scalar)
30 !$omp target defaultmap(tofrom:scalar)
34 !CHECK: !$omp end target
37 !PARSE-TREE: OmpBeginBlockDirective
38 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
39 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
40 !PARSE-TREE: ImplicitBehavior = Tofrom
41 !PARSE-TREE: VariableCategory = Scalar
43 !CHECK: !$omp target defaultmap(alloc:scalar)
44 !$omp target defaultmap(alloc:scalar)
46 !CHECK: !$omp end target
49 !PARSE-TREE: OmpBeginBlockDirective
50 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
51 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
52 !PARSE-TREE: ImplicitBehavior = Alloc
53 !PARSE-TREE: VariableCategory = Scalar
55 !CHECK: !$omp target defaultmap(none)
56 !$omp target defaultmap(none)
58 !CHECK: !$omp end target
61 !PARSE-TREE: OmpBeginBlockDirective
62 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
63 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
64 !PARSE-TREE: ImplicitBehavior = None
66 !CHECK: !$omp target defaultmap(none:scalar)
67 !$omp target defaultmap(none:scalar)
69 !CHECK: !$omp end target
72 !PARSE-TREE: OmpBeginBlockDirective
73 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
74 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
75 !PARSE-TREE: ImplicitBehavior = None
76 !PARSE-TREE: VariableCategory = Scalar
78 !CHECK: !$omp target defaultmap(to:scalar)
79 !$omp target defaultmap(to:scalar)
81 !CHECK: !$omp end target
84 !PARSE-TREE: OmpBeginBlockDirective
85 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
86 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
87 !PARSE-TREE: ImplicitBehavior = To
88 !PARSE-TREE: VariableCategory = Scalar
90 !CHECK: !$omp target defaultmap(firstprivate:scalar)
91 !$omp target defaultmap(firstprivate:scalar)
93 !CHECK: !$omp end target
96 !PARSE-TREE: OmpBeginBlockDirective
97 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
98 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
99 !PARSE-TREE: ImplicitBehavior = Firstprivate
100 !PARSE-TREE: VariableCategory = Scalar
102 !CHECK: !$omp target defaultmap(tofrom:aggregate)
103 !$omp target defaultmap(tofrom:aggregate)
106 data01_a
%arr(1) = 100
107 data01_a
%arr(2) = 245
108 !CHECK: !$omp end target
111 !PARSE-TREE: OmpBeginBlockDirective
112 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
113 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
114 !PARSE-TREE: ImplicitBehavior = Tofrom
115 !PARSE-TREE: VariableCategory = Aggregate
117 !CHECK: !$omp target defaultmap(tofrom:allocatable)
118 !$omp target defaultmap(tofrom:allocatable)
120 !CHECK: !$omp end target
123 !PARSE-TREE: OmpBeginBlockDirective
124 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
125 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
126 !PARSE-TREE: ImplicitBehavior = Tofrom
127 !PARSE-TREE: VariableCategory = Allocatable
129 !CHECK: !$omp target defaultmap(default:pointer)
130 !$omp target defaultmap(default:pointer)
134 !CHECK: !$omp end target
137 !PARSE-TREE: OmpBeginBlockDirective
138 !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target
139 !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
140 !PARSE-TREE: ImplicitBehavior = Default
141 !PARSE-TREE: VariableCategory = Pointer
144 !CHECK-LABEL: end program main