brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.6 KiB · c080d47 Raw
210 lines · plain
1! REQUIRES: openmp_runtime2! RUN: %flang_fc1 -fdebug-unparse -fopenmp-version=52 %openmp_flags %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s 3! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp-version=52 %openmp_flags %s | FileCheck --check-prefix="PARSE-TREE" %s4 5SUBROUTINE test_interop_01()6  !$OMP INTEROP DEVICE(1)7  PRINT *,'pass'8END SUBROUTINE test_interop_019 10!UNPARSE: SUBROUTINE test_interop_0111!UNPARSE: !$OMP INTEROP  DEVICE(1_4)12!UNPARSE:  PRINT *, "pass"13!UNPARSE: END SUBROUTINE test_interop_0114 15!PARSE-TREE: | SubroutineStmt16!PARSE-TREE: | | Name = 'test_interop_01'17!PARSE-TREE: | SpecificationPart18!PARSE-TREE: | | ImplicitPart -> 19!PARSE-TREE: | ExecutionPart -> Block20!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification21!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop22!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Device -> OmpDeviceClause23!PARSE-TREE: | | | | Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '1'24!PARSE-TREE: | | | Flags = {}25!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt26!PARSE-TREE: | | | Format -> Star27!PARSE-TREE: | | | OutputItem -> Expr -> LiteralConstant -> CharLiteralConstant28!PARSE-TREE: | | | | string = 'pass'29!PARSE-TREE: | EndSubroutineStmt -> Name = 'test_interop_01'30 31SUBROUTINE test_interop_02()32  USE omp_lib33  INTEGER(OMP_INTEROP_KIND) :: obj1, obj2, obj334  !$OMP INTEROP INIT(TARGETSYNC: obj) USE(obj1) DESTROY(obj3)35  PRINT *,'pass'36END SUBROUTINE test_interop_0237 38!UNPARSE: SUBROUTINE test_interop_0239!UNPARSE:  USE :: omp_lib40!UNPARSE:  INTEGER(KIND=8_4) obj1, obj2, obj341!UNPARSE: !$OMP INTEROP  INIT(TARGETSYNC: obj) USE(obj1) DESTROY(obj3)42!UNPARSE:  PRINT *, "pass"43!UNPARSE: END SUBROUTINE test_interop_0244 45!PARSE-TREE: | SubroutineStmt46!PARSE-TREE: | | Name = 'test_interop_02'47!PARSE-TREE: | SpecificationPart48!PARSE-TREE: | | UseStmt49!PARSE-TREE: | | | Name = 'omp_lib'50!PARSE-TREE: | | ImplicitPart -> 51!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt52!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'53!PARSE-TREE: | | | EntityDecl54!PARSE-TREE: | | | | Name = 'obj1'55!PARSE-TREE: | | | EntityDecl56!PARSE-TREE: | | | | Name = 'obj2'57!PARSE-TREE: | | | EntityDecl58!PARSE-TREE: | | | | Name = 'obj3'59!PARSE-TREE: | ExecutionPart -> Block60!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification61!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop62!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Init -> OmpInitClause63!PARSE-TREE: | | | | Modifier -> OmpInteropType -> Value = TargetSync64!PARSE-TREE: | | | | OmpObject -> Designator -> DataRef -> Name = 'obj'65!PARSE-TREE: | | | OmpClause -> Use -> OmpUseClause -> OmpObject -> Designator -> DataRef -> Name = 'obj1'66!PARSE-TREE: | | | OmpClause -> Destroy -> OmpDestroyClause -> OmpObject -> Designator -> DataRef -> Name = 'obj3'67!PARSE-TREE: | | | Flags = {}68!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt69!PARSE-TREE: | | | Format -> Star70!PARSE-TREE: | | | OutputItem -> Expr -> LiteralConstant -> CharLiteralConstant71!PARSE-TREE: | | | | string = 'pass'72!PARSE-TREE: | EndSubroutineStmt -> Name = 'test_interop_02'73 74SUBROUTINE test_interop_03()75  USE omp_lib76  INTEGER(OMP_INTEROP_KIND) :: obj77  !$OMP INTEROP INIT(TARGETSYNC: obj) DEPEND(INOUT: obj)78  PRINT *,'pass'79END SUBROUTINE test_interop_0380 81!UNPARSE: SUBROUTINE test_interop_0382!UNPARSE:  USE :: omp_lib83!UNPARSE:  INTEGER(KIND=8_4) obj84!UNPARSE: !$OMP INTEROP  INIT(TARGETSYNC: obj) DEPEND(INOUT: obj)85!UNPARSE:  PRINT *, "pass"86!UNPARSE: END SUBROUTINE test_interop_0387 88!PARSE-TREE: | SubroutineStmt89!PARSE-TREE: | | Name = 'test_interop_03'90!PARSE-TREE: | SpecificationPart91!PARSE-TREE: | | UseStmt92!PARSE-TREE: | | | Name = 'omp_lib'93!PARSE-TREE: | | ImplicitPart -> 94!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt95!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'96!PARSE-TREE: | | | EntityDecl97!PARSE-TREE: | | | | Name = 'obj'98!PARSE-TREE: | ExecutionPart -> Block99!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification100!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop101!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Init -> OmpInitClause102!PARSE-TREE: | | | | Modifier -> OmpInteropType -> Value = TargetSync103!PARSE-TREE: | | | | OmpObject -> Designator -> DataRef -> Name = 'obj'104!PARSE-TREE: | | | OmpClause -> Depend -> OmpDependClause -> TaskDep105!PARSE-TREE: | | | | Modifier -> OmpTaskDependenceType -> Value = Inout106!PARSE-TREE: | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'obj'107!PARSE-TREE: | | | Flags = {}108!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt109!PARSE-TREE: | | | Format -> Star110!PARSE-TREE: | | | OutputItem -> Expr -> LiteralConstant -> CharLiteralConstant111!PARSE-TREE: | | | | string = 'pass'112!PARSE-TREE: | EndSubroutineStmt -> Name = 'test_interop_03'113 114SUBROUTINE test_interop_04()115  USE omp_lib116  INTEGER(OMP_INTEROP_KIND) :: obj117  INTEGER, DIMENSION(1,10) :: arr118  !$OMP INTEROP INIT(PREFER_TYPE("cuda"),TARGETSYNC,TARGET: obj) DEPEND(INOUT: arr) NOWAIT119  PRINT *,'pass'120END SUBROUTINE test_interop_04121 122!UNPARSE: SUBROUTINE test_interop_04123!UNPARSE:  USE :: omp_lib124!UNPARSE:  INTEGER(KIND=8_4) obj125!UNPARSE:  INTEGER, DIMENSION(1_4,10_4) :: arr126!UNPARSE: !$OMP INTEROP  INIT(PREFER_TYPE("cuda"),TARGETSYNC,TARGET: obj) DEPEND(INOUT: &127!UNPARSE: !$OMP&arr) NOWAIT128!UNPARSE:  PRINT *, "pass"129!UNPARSE: END SUBROUTINE test_interop_04130 131!PARSE-TREE: | SubroutineStmt132!PARSE-TREE: | | Name = 'test_interop_04'133!PARSE-TREE: | SpecificationPart134!PARSE-TREE: | | UseStmt135!PARSE-TREE: | | | Name = 'omp_lib'136!PARSE-TREE: | | ImplicitPart -> 137!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt138!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'139!PARSE-TREE: | | | EntityDecl140!PARSE-TREE: | | | | Name = 'obj'141!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt142!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> 143!PARSE-TREE: | | | AttrSpec -> ArraySpec -> ExplicitShapeSpec144!PARSE-TREE: | | | | SpecificationExpr -> Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '1'145!PARSE-TREE: | | | ExplicitShapeSpec146!PARSE-TREE: | | | | SpecificationExpr -> Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '10'147!PARSE-TREE: | | | EntityDecl148!PARSE-TREE: | | | | Name = 'arr'149!PARSE-TREE: | ExecutionPart -> Block150!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification151!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop152!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Init -> OmpInitClause153!PARSE-TREE: | | | | Modifier -> OmpInteropPreference -> OmpInteropRuntimeIdentifier -> CharLiteralConstant154!PARSE-TREE: | | | | | string = 'cuda'155!PARSE-TREE: | | | | Modifier -> OmpInteropType -> Value = TargetSync156!PARSE-TREE: | | | | Modifier -> OmpInteropType -> Value = Target157!PARSE-TREE: | | | | OmpObject -> Designator -> DataRef -> Name = 'obj'158!PARSE-TREE: | | | OmpClause -> Depend -> OmpDependClause -> TaskDep159!PARSE-TREE: | | | | Modifier -> OmpTaskDependenceType -> Value = Inout160!PARSE-TREE: | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'arr'161!PARSE-TREE: | | | OmpClause -> Nowait162!PARSE-TREE: | | | Flags = {}163!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt164!PARSE-TREE: | | | Format -> Star165!PARSE-TREE: | | | OutputItem -> Expr -> LiteralConstant -> CharLiteralConstant166!PARSE-TREE: | | | | string = 'pass'167!PARSE-TREE: | EndSubroutineStmt -> Name = 'test_interop_04'168 169SUBROUTINE test_interop_05()170  USE omp_lib171  INTEGER(OMP_INTEROP_KIND) :: obj172  !$OMP INTEROP INIT(PREFER_TYPE(omp_ifr_sycl), TARGETSYNC: obj) DEVICE(DEVICE_NUM:0)173  PRINT *,'pass'174END SUBROUTINE test_interop_05175 176!UNPARSE: SUBROUTINE test_interop_05177!UNPARSE:  USE :: omp_lib178!UNPARSE:  INTEGER(KIND=8_4) obj179!UNPARSE: !$OMP INTEROP  INIT(PREFER_TYPE(4_4),TARGETSYNC: obj) DEVICE(DEVICE_NUM: 0_4)180!UNPARSE:  PRINT *, "pass"181!UNPARSE: END SUBROUTINE test_interop_05182 183!PARSE-TREE: | SubroutineStmt184!PARSE-TREE: | | Name = 'test_interop_05'185!PARSE-TREE: | SpecificationPart186!PARSE-TREE: | | UseStmt187!PARSE-TREE: | | | Name = 'omp_lib'188!PARSE-TREE: | | ImplicitPart -> 189!PARSE-TREE: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt190!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec -> KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_interop_kind'191!PARSE-TREE: | | | EntityDecl192!PARSE-TREE: | | | | Name = 'obj'193!PARSE-TREE: | ExecutionPart -> Block194!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPInteropConstruct -> OmpDirectiveSpecification195!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = interop196!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Init -> OmpInitClause197!PARSE-TREE: | | | | Modifier -> OmpInteropPreference -> OmpInteropRuntimeIdentifier -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'omp_ifr_sycl'198!PARSE-TREE: | | | | Modifier -> OmpInteropType -> Value = TargetSync199!PARSE-TREE: | | | | OmpObject -> Designator -> DataRef -> Name = 'obj'200!PARSE-TREE: | | | OmpClause -> Device -> OmpDeviceClause201!PARSE-TREE: | | | | Modifier -> OmpDeviceModifier -> Value = Device_Num202!PARSE-TREE: | | | | Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '0'203!PARSE-TREE: | | | Flags = {}204!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt205!PARSE-TREE: | | | Format -> Star206!PARSE-TREE: | | | OutputItem -> Expr -> LiteralConstant -> CharLiteralConstant207!PARSE-TREE: | | | | string = 'pass'208!PARSE-TREE: | EndSubroutineStmt -> Name = 'test_interop_05'209 210