[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Parser / omp-defaultmap-unparse.f90
blobe7333b02bc8f6b13254d621ddc02bdff661772df
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
3 program main
4 !CHECK-LABEL: program main
5 implicit none
7 integer, parameter :: N = 256
9 type data01
10 integer :: a
11 integer :: arr(N)
12 end type
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(:)
20 arrA = 1.414
21 arrB = 3.14
22 arrC = -1
23 data01_a%a = -1
24 data01_arr = -1
25 allocate(alloc_arr(N))
26 alloc_arr = -1
29 !CHECK: !$omp target defaultmap(tofrom:scalar)
30 !$omp target defaultmap(tofrom:scalar)
31 do i = 1, N
32 a = 3.14
33 enddo
34 !CHECK: !$omp end target
35 !$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)
45 a = 4.56
46 !CHECK: !$omp end target
47 !$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)
57 a = 6.78
58 !CHECK: !$omp end target
59 !$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)
68 a = 4.78
69 !CHECK: !$omp end target
70 !$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)
80 a = 2.39
81 !CHECK: !$omp end target
82 !$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)
92 a = 9.45
93 !CHECK: !$omp end target
94 !$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)
104 arrC(1) = 10
105 data01_a%a = 11
106 data01_a%arr(1) = 100
107 data01_a%arr(2) = 245
108 !CHECK: !$omp end target
109 !$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)
119 alloc_arr(23) = 234
120 !CHECK: !$omp end target
121 !$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)
131 ptrArr=>arrC
132 ptrArr(2) = 5
133 prtArr(200) = 34
134 !CHECK: !$omp end target
135 !$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
143 end program main
144 !CHECK-LABEL: end program main