brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 36f301c Raw
69 lines · plain
1! RUN: %flang_fc1 -fopenmp -fdebug-dump-parse-tree %s | FileCheck %s --check-prefix=PARSE-TREE2! RUN: %flang_fc1 -fopenmp -fdebug-unparse %s | FileCheck %s --check-prefix="UNPARSE"3 4integer function func(a, b, c)5  integer  :: a, b, c6  func = a + b + c7end function func8 9subroutine sub(x)10  use iso_c_binding11  integer :: func12  integer :: r13  type(c_ptr) :: x14  integer :: a = 14, b = 7, c = 2115 16!UNPARSE: !$OMP DISPATCH DEVICE(3_4) NOWAIT NOCONTEXT(.false._4) NOVARIANTS(.true._4)17!UNPARSE:   r=func(a,b,c)18!UNPARSE: !$OMP END DISPATCH19 20!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPDispatchConstruct21!PARSE-TREE: | OmpBeginDirective22!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch23!PARSE-TREE: | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause24!PARSE-TREE: | | | Scalar -> Integer -> Expr = '3_4'25!PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '3'26!PARSE-TREE: | | OmpClause -> Nowait27!PARSE-TREE: | | OmpClause -> Nocontext -> Scalar -> Logical -> Expr = '.false._4'28!PARSE-TREE: | | | LiteralConstant -> LogicalLiteralConstant29!PARSE-TREE: | | | | bool = 'false'30!PARSE-TREE: | | OmpClause -> Novariants -> Scalar -> Logical -> Expr = '.true._4'31!PARSE-TREE: | | | EQ32!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 = {}37!PARSE-TREE: | Block38!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt39![...]40!PARSE-TREE: | OmpEndDirective41!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch42!PARSE-TREE: | | OmpClauseList ->43!PARSE-TREE: | | Flags = {}44 45  !$omp dispatch device(3) nowait nocontext(.false.) novariants(1.eq.1)46  r = func(a, b, c)47  !$omp end dispatch48 49!! Test the "no end dispatch" option.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 -> OpenMPDispatchConstruct54!PARSE-TREE: | OmpBeginDirective55!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = dispatch56!PARSE-TREE: | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause57!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 = {}61!PARSE-TREE: | Block62!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt63!PARSE-TREE-NOT: OmpEndDirective64 65  !$omp dispatch device(3) is_device_ptr(x)66  r = func(a+1, b+2, c+3)67 68end subroutine sub69