1- ! RUN: %flang_fc1 -fopenmp -fdebug-dump-parse-tree %s | FileCheck %s
1+ ! RUN: %flang_fc1 -fopenmp -fdebug-dump-parse-tree %s | FileCheck %s --check-prefix=PARSE-TREE
22! RUN: %flang_fc1 -fopenmp -fdebug-unparse %s | FileCheck %s --check-prefix="UNPARSE"
33
44integer function func (a , b , c )
@@ -12,40 +12,57 @@ subroutine sub(x)
1212 integer :: r
1313 type (c_ptr) :: x
1414 integer :: a = 14 , b = 7 , c = 21
15+
1516! UNPARSE: !$OMP DISPATCH DEVICE(3_4) NOWAIT NOCONTEXT(.false._4) NOVARIANTS(.true._4)
16- ! CHECK: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDispatchConstruct
17- ! CHECK-NEXT: | | | OmpDispatchDirective
18- ! CHECK: | | | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause
19- ! CHECK-NEXT: | | | | | Scalar -> Integer -> Expr = '3_4'
20- ! CHECK-NEXT: | | | | | | LiteralConstant -> IntLiteralConstant = '3'
21- ! CHECK-NEXT: | | | | OmpClause -> Nowait
22- ! CHECK-NEXT: | | | | OmpClause -> Nocontext -> Scalar -> Logical -> Expr = '.false._4'
23- ! CHECK-NEXT: | | | | | LiteralConstant -> LogicalLiteralConstant
24- ! CHECK-NEXT: | | | | | | bool = 'false'
25- ! CHECK-NEXT: | | | | OmpClause -> Novariants -> Scalar -> Logical -> Expr = '.true._4'
26- ! CHECK-NEXT: | | | | | EQ
27- ! CHECK-NEXT: | | | | | | Expr = '1_4'
28- ! CHECK-NEXT: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
29- ! CHECK-NEXT: | | | | | | Expr = '1_4'
30- ! CHECK-NEXT: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
31- ! CHECK-NEXT: | | | Block
32-
17+ ! UNPARSE: r=func(a,b,c)
18+ ! UNPARSE: !$OMP END DISPATCH
19+
20+ ! PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDispatchConstruct
21+ ! PARSE-TREE: | OmpDirectiveSpecification
22+ ! PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch
23+ ! PARSE-TREE: | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause
24+ ! PARSE-TREE: | | | Scalar -> Integer -> Expr = '3_4'
25+ ! PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '3'
26+ ! PARSE-TREE: | | OmpClause -> Nowait
27+ ! PARSE-TREE: | | OmpClause -> Nocontext -> Scalar -> Logical -> Expr = '.false._4'
28+ ! PARSE-TREE: | | | LiteralConstant -> LogicalLiteralConstant
29+ ! PARSE-TREE: | | | | bool = 'false'
30+ ! PARSE-TREE: | | OmpClause -> Novariants -> Scalar -> Logical -> Expr = '.true._4'
31+ ! PARSE-TREE: | | | EQ
32+ ! PARSE-TREE: | | | | Expr = '1_4'
33+ ! PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '1'
34+ ! PARSE-TREE: | | | | Expr = '1_4'
35+ ! PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '1'
36+ ! PARSE-TREE: | | Flags = None
37+ ! PARSE-TREE: | Block
38+ ! PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt
39+ ! [...]
40+ ! PARSE-TREE: | OmpDirectiveSpecification
41+ ! PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch
42+ ! PARSE-TREE: | | OmpClauseList ->
43+ ! PARSE-TREE: | | Flags = None
44+
3345 ! $omp dispatch device(3) nowait nocontext(.false.) novariants(1.eq.1)
3446 r = func(a, b, c)
35- ! UNPARSE: !$OMP END DISPATCH
36- ! CHECK: | | | OmpEndDispatchDirective
3747 ! $omp end dispatch
3848
3949! ! Test the "no end dispatch" option.
40- ! UNPARSE: !$OMP DISPATCH DEVICE(3_4) IS_DEVICE_PTR(x)
41- ! CHECK: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDispatchConstruct
42- ! CHECK-NEXT: | | | OmpDispatchDirective
43- ! CHECK: | | | | OmpClause -> IsDevicePtr -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'
50+ ! UNPARSE: !$OMP DISPATCH DEVICE(3_4) IS_DEVICE_PTR(x)
51+ ! UNPARSE: r=func(a+1_4,b+2_4,c+3_4)
52+
53+ ! PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDispatchConstruct
54+ ! PARSE-TREE: | OmpDirectiveSpecification
55+ ! PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch
56+ ! PARSE-TREE: | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause
57+ ! PARSE-TREE: | | | Scalar -> Integer -> Expr = '3_4'
58+ ! PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '3'
59+ ! PARSE-TREE: | | OmpClause -> IsDevicePtr -> OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'
60+ ! PARSE-TREE: | | Flags = None
61+ ! PARSE-TREE: | Block
62+ ! PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt
63+ ! PARSE-TREE-NOT: OmpDirectiveSpecification
64+
4465 ! $omp dispatch device(3) is_device_ptr(x)
4566 r = func(a+1 , b+2 , c+3 )
46- ! CHECK-NOT: | | | OmpEndDispatchDirective
4767
4868end subroutine sub
49-
50-
51-
0 commit comments