22! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
33
44subroutine sub0
5- ! CHECK: !$OMP DECLARE VARIANT (sub:vsub) MATCH(CONSTRUCT={PARALLEL})
6- ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective
7- ! PARSE-TREE: | Verbatim
8- ! PARSE-TREE: | Name = 'sub'
9- ! PARSE-TREE: | Name = 'vsub'
5+ ! CHECK: !$OMP DECLARE VARIANT(sub:vsub) MATCH(CONSTRUCT={PARALLEL})
6+
7+ ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification
8+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant
9+ ! PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpBaseVariantNames
10+ ! PARSE-TREE: | | OmpObject -> Designator -> DataRef -> Name = 'sub'
11+ ! PARSE-TREE: | | OmpObject -> Designator -> DataRef -> Name = 'vsub'
1012! PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
1113! PARSE-TREE: | | OmpTraitSetSelectorName -> Value = Construct
1214! PARSE-TREE: | | OmpTraitSelector
1315! PARSE-TREE: | | | OmpTraitSelectorName -> llvm::omp::Directive = parallel
16+ ! PARSE-TREE: | Flags = None
17+
1418 ! $omp declare variant (sub:vsub) match (construct={parallel})
1519contains
1620 subroutine vsub
@@ -30,14 +34,17 @@ subroutine vsub (v1)
3034 integer , value :: v1
3135 end
3236 subroutine sub (v1 )
33- ! CHECK: !$OMP DECLARE VARIANT (vsub) MATCH(CONSTRUCT={DISPATCH}
34- ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective
35- ! PARSE-TREE: | Verbatim
36- ! PARSE-TREE: | Name = 'vsub'
37+ ! CHECK: !$OMP DECLARE VARIANT(vsub) MATCH(CONSTRUCT={DISPATCH})
38+
39+ ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification
40+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant
41+ ! PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'vsub'
3742! PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
3843! PARSE-TREE: | | OmpTraitSetSelectorName -> Value = Construct
3944! PARSE-TREE: | | OmpTraitSelector
4045! PARSE-TREE: | | | OmpTraitSelectorName -> llvm::omp::Directive = dispatch
46+ ! PARSE-TREE: | Flags = None
47+
4148 ! $omp declare variant(vsub), match(construct={dispatch})
4249 integer , value :: v1
4350 end
@@ -56,17 +63,20 @@ subroutine vsub (v1, a1, a2)
5663 integer (omp_interop_kind), value :: a2
5764 end
5865 subroutine sub (v1 )
59- ! CHECK: !$OMP DECLARE VARIANT (vsub) MATCH(CONSTRUCT={DISPATCH}) APPEND_ARGS(INTEROP(T&
60- ! CHECK: !$OMP&ARGET),INTEROP(TARGET))
61- ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective
62- ! PARSE-TREE: | Verbatim
63- ! PARSE-TREE: | Name = 'vsub'
66+ ! CHECK: !$OMP DECLARE VARIANT(vsub) MATCH(CONSTRUCT={DISPATCH}) APPEND_ARGS(INTEROP(TA&
67+ ! CHECK: !$OMP&RGET),INTEROP(TARGET))
68+
69+ ! PARSE-TREE: OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification
70+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant
71+ ! PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'vsub'
6472! PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
6573! PARSE-TREE: | | OmpTraitSetSelectorName -> Value = Construct
6674! PARSE-TREE: | | OmpTraitSelector
6775! PARSE-TREE: | | | OmpTraitSelectorName -> llvm::omp::Directive = dispatch
6876! PARSE-TREE: | OmpClause -> AppendArgs -> OmpAppendArgsClause -> OmpAppendOp -> OmpInteropType -> Value = Target
6977! PARSE-TREE: | OmpAppendOp -> OmpInteropType -> Value = Target
78+ ! PARSE-TREE: | Flags = None
79+
7080 ! $omp declare variant(vsub), match(construct={dispatch}), append_args (interop(target), interop(target))
7181 integer , value :: v1
7282 end
@@ -81,11 +91,12 @@ subroutine sb3 (x1, x2)
8191contains
8292 subroutine sub (v1 , v2 )
8393 type (c_ptr), value :: v1, v2
84- ! CHECK: !$OMP DECLARE VARIANT (vsub) MATCH(CONSTRUCT={DISPATCH}) ADJUST_ARGS(NOTHING:v&
85- ! CHECK: !$OMP&1) ADJUST_ARGS(NEED_DEVICE_PTR:v2)
86- ! PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective
87- ! PARSE-TREE: | Verbatim
88- ! PARSE-TREE: | Name = 'vsub'
94+ ! CHECK: !$OMP DECLARE VARIANT(vsub) MATCH(CONSTRUCT={DISPATCH}) ADJUST_ARGS(NOTHING:v1&
95+ ! CHECK: !$OMP&) ADJUST_ARGS(NEED_DEVICE_PTR:v2)
96+
97+ ! PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification
98+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant
99+ ! PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'vsub'
89100! PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
90101! PARSE-TREE: | | OmpTraitSetSelectorName -> Value = Construct
91102! PARSE-TREE: | | OmpTraitSelector
@@ -96,6 +107,8 @@ subroutine sub (v1, v2)
96107! PARSE-TREE: | OmpClause -> AdjustArgs -> OmpAdjustArgsClause
97108! PARSE-TREE: | | OmpAdjustOp -> Value = Need_Device_Ptr
98109! PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'v2'
110+ ! PARSE-TREE: | Flags = None
111+
99112 ! $omp declare variant(vsub) match ( construct = { dispatch } ) adjust_args(nothing : v1 ) adjust_args(need_device_ptr : v2)
100113 end
101114 subroutine vsub (v1 , v2 )
@@ -119,13 +132,15 @@ subroutine f2 (x, y)
119132 ! $omp declare variant (f1) match (construct={simd(uniform(y))})
120133 end
121134end subroutine
122- ! CHECK: !$OMP DECLARE VARIANT (f1) MATCH(CONSTRUCT={SIMD(UNIFORM(y))})
123- ! PARSE-TREE: | | | | DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective
124- ! PARSE-TREE-NEXT: | | | | | Verbatim
125- ! PARSE-TREE-NEXT: | | | | | Name = 'f1'
126- ! PARSE-TREE-NEXT: | | | | | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
127- ! PARSE-TREE-NEXT: | | | | | | OmpTraitSetSelectorName -> Value = Construct
128- ! PARSE-TREE-NEXT: | | | | | | OmpTraitSelector
129- ! PARSE-TREE-NEXT: | | | | | | | OmpTraitSelectorName -> Value = Simd
130- ! PARSE-TREE-NEXT: | | | | | | | Properties
131- ! PARSE-TREE-NEXT: | | | | | | | | OmpTraitProperty -> OmpClause -> Uniform -> Name = 'y'
135+ ! CHECK: !$OMP DECLARE VARIANT(f1) MATCH(CONSTRUCT={SIMD(UNIFORM(y))})
136+
137+ ! PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification
138+ ! PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant
139+ ! PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'f1'
140+ ! PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector
141+ ! PARSE-TREE: | | OmpTraitSetSelectorName -> Value = Construct
142+ ! PARSE-TREE: | | OmpTraitSelector
143+ ! PARSE-TREE: | | | OmpTraitSelectorName -> Value = Simd
144+ ! PARSE-TREE: | | | Properties
145+ ! PARSE-TREE: | | | | OmpTraitProperty -> OmpClause -> Uniform -> Name = 'y'
146+ ! PARSE-TREE: | Flags = None
0 commit comments