brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.6 KiB · 0d43a32 Raw
252 lines · plain
1!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=52 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s2!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=52 %s | FileCheck --check-prefix="PARSE-TREE" %s3 4subroutine f005  continue6  !$omp metadirective when(construct={target, parallel}: nothing)7end8 9!UNPARSE: SUBROUTINE f0010!UNPARSE:  CONTINUE11!UNPARSE: !$OMP METADIRECTIVE WHEN(CONSTRUCT={TARGET, PARALLEL}: NOTHING)12!UNPARSE: END SUBROUTINE13 14!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective15!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause16!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector17!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Construct18!PARSE-TREE: | | | OmpTraitSelector19!PARSE-TREE: | | | | OmpTraitSelectorName -> llvm::omp::Directive = target20!PARSE-TREE: | | | OmpTraitSelector21!PARSE-TREE: | | | | OmpTraitSelectorName -> llvm::omp::Directive = parallel22!PARSE-TREE: | | OmpDirectiveSpecification23!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing24!PARSE-TREE: | | | OmpClauseList ->25 26subroutine f0127  continue28  !$omp metadirective when(target_device={kind(host), device_num(1)}: nothing)29end30 31!UNPARSE: SUBROUTINE f0132!UNPARSE:  CONTINUE33!UNPARSE: !$OMP METADIRECTIVE WHEN(TARGET_DEVICE={KIND(host), DEVICE_NUM(1_4)}: NOTHING)34!UNPARSE: END SUBROUTINE35 36!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective37!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause38!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector39!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Target_Device40!PARSE-TREE: | | | OmpTraitSelector41!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Kind42!PARSE-TREE: | | | | Properties43!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyName -> string = 'host'44!PARSE-TREE: | | | OmpTraitSelector45!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Device_Num46!PARSE-TREE: | | | | Properties47!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '1_4'48!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '1'49!PARSE-TREE: | | OmpDirectiveSpecification50!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing51!PARSE-TREE: | | | OmpClauseList ->52 53subroutine f0254  continue55  !$omp metadirective when(target_device={kind(any), device_num(7)}: nothing)56end57 58!UNPARSE: SUBROUTINE f0259!UNPARSE:  CONTINUE60!UNPARSE: !$OMP METADIRECTIVE WHEN(TARGET_DEVICE={KIND(any), DEVICE_NUM(7_4)}: NOTHING)61!UNPARSE: END SUBROUTINE62 63!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective64!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause65!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector66!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Target_Device67!PARSE-TREE: | | | OmpTraitSelector68!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Kind69!PARSE-TREE: | | | | Properties70!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyName -> string = 'any'71!PARSE-TREE: | | | OmpTraitSelector72!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Device_Num73!PARSE-TREE: | | | | Properties74!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '7_4'75!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '7'76!PARSE-TREE: | | OmpDirectiveSpecification77!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing78!PARSE-TREE: | | | OmpClauseList ->79 80subroutine f0381  continue82  !$omp metadirective &83  !$omp & when(implementation={atomic_default_mem_order(acq_rel)}: nothing)84end85 86!UNPARSE: SUBROUTINE f0387!UNPARSE:  CONTINUE88!UNPARSE: !$OMP METADIRECTIVE WHEN(IMPLEMENTATION={ATOMIC_DEFAULT_MEM_ORDER(ACQ_REL)}: N&89!UNPARSE: !$OMP&OTHING)90!UNPARSE: END SUBROUTINE91 92!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective93!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause94!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector95!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Implementation96!PARSE-TREE: | | | OmpTraitSelector97!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Atomic_Default_Mem_Order98!PARSE-TREE: | | | | Properties99!PARSE-TREE: | | | | | OmpTraitProperty -> OmpClause -> AcqRel100!PARSE-TREE: | | OmpDirectiveSpecification101!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing102!PARSE-TREE: | | | OmpClauseList ->103 104subroutine f04105  continue106  !$omp metadirective &107  !$omp when(implementation={extension_trait(haha(1), foo(baz, "bar"(1)))}: nothing)108end109 110!UNPARSE: SUBROUTINE f04111!UNPARSE:  CONTINUE112!UNPARSE: !$OMP METADIRECTIVE WHEN(IMPLEMENTATION={extension_trait(haha(1_4), foo(baz,bar(1_4)&113!UNPARSE: !$OMP&))}: NOTHING)114!UNPARSE: END SUBROUTINE115 116!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective117!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause118!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector119!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Implementation120!PARSE-TREE: | | | OmpTraitSelector121!PARSE-TREE: | | | | OmpTraitSelectorName -> string = 'extension_trait'122!PARSE-TREE: | | | | Properties123!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyExtension -> Complex124!PARSE-TREE: | | | | | | OmpTraitPropertyName -> string = 'haha'125!PARSE-TREE: | | | | | | OmpTraitPropertyExtension -> Scalar -> Expr = '1_4'126!PARSE-TREE: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'127!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyExtension128!PARSE-TREE: | | | | | | OmpTraitPropertyName -> string = 'foo'129!PARSE-TREE: | | | | | | OmpTraitPropertyExtension -> OmpTraitPropertyName -> string = 'baz'130!PARSE-TREE: | | | | | | OmpTraitPropertyExtension -> Complex131!PARSE-TREE: | | | | | | | OmpTraitPropertyName -> string = 'bar'132!PARSE-TREE: | | | | | | | OmpTraitPropertyExtension -> Scalar -> Expr = '1_4'133!PARSE-TREE: | | | | | | | | LiteralConstant -> IntLiteralConstant = '1'134!PARSE-TREE: | | OmpDirectiveSpecification135!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing136!PARSE-TREE: | | | OmpClauseList ->137 138subroutine f05(x)139  integer :: x140  continue141  !$omp metadirective &142  !$omp & when(user={condition(score(100): .true.)}: &143  !$omp &    parallel do reduction(+: x)) &144  !$omp & otherwise(nothing)145  do i = 1, 10146  enddo147end148 149!UNPARSE: SUBROUTINE f05 (x)150!UNPARSE:  INTEGER x151!UNPARSE:  CONTINUE152!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(SCORE(100_4): .true._4)}: PARALLEL DO REDUCTION(+:&153!UNPARSE: !$OMP& x)) OTHERWISE(NOTHING)154!UNPARSE:  DO i=1_4,10_4155!UNPARSE:  END DO156!UNPARSE: END SUBROUTINE157 158!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective159!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause160!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector161!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User162!PARSE-TREE: | | | OmpTraitSelector163!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition164!PARSE-TREE: | | | | Properties165!PARSE-TREE: | | | | | OmpTraitScore -> Scalar -> Integer -> Expr = '100_4'166!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '100'167!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'168!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant169!PARSE-TREE: | | | | | | | bool = 'true'170!PARSE-TREE: | | OmpDirectiveSpecification171!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = parallel do172!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause173!PARSE-TREE: | | | | Modifier -> OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add174!PARSE-TREE: | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'175!PARSE-TREE: | OmpClause -> Otherwise -> OmpOtherwiseClause -> OmpDirectiveSpecification176!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = nothing177!PARSE-TREE: | | OmpClauseList ->178 179subroutine f06180  continue181  ! Two trait set selectors182  !$omp metadirective &183  !$omp & when(implementation={vendor("amd")}, &184  !$omp &      user={condition(.true.)}: nothing)185end186 187!UNPARSE: SUBROUTINE f06188!UNPARSE:  CONTINUE189!UNPARSE: !$OMP METADIRECTIVE WHEN(IMPLEMENTATION={VENDOR(amd)}, USER={CONDITION(.true._4)}: NOT&190!UNPARSE: !$OMP&HING)191!UNPARSE: END SUBROUTINE192 193!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OmpMetadirectiveDirective194!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause195!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector196!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Implementation197!PARSE-TREE: | | | OmpTraitSelector198!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Vendor199!PARSE-TREE: | | | | Properties200!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyName -> string = 'amd'201!PARSE-TREE: | | OmpTraitSetSelector202!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User203!PARSE-TREE: | | | OmpTraitSelector204!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition205!PARSE-TREE: | | | | Properties206!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'207!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant208!PARSE-TREE: | | | | | | | bool = 'true'209!PARSE-TREE: | | OmpDirectiveSpecification210!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = nothing211!PARSE-TREE: | | | OmpClauseList ->212 213subroutine f07214  ! Declarative metadirective215  !$omp metadirective &216  !$omp & when(implementation={vendor("amd")}: declare simd) &217  !$omp & when(user={condition(.true.)}: declare target) &218  !$omp & otherwise(nothing)219end220 221!UNPARSE: SUBROUTINE f07222!UNPARSE: !$OMP METADIRECTIVE WHEN(IMPLEMENTATION={VENDOR(amd)}: DECLARE SIMD) WHEN(USER&223!UNPARSE: !$OMP&={CONDITION(.true._4)}: DECLARE TARGET) OTHERWISE(NOTHING)224!UNPARSE: END SUBROUTINE225 226!PARSE-TREE: OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective227!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause228!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector229!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = Implementation230!PARSE-TREE: | | | OmpTraitSelector231!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Vendor232!PARSE-TREE: | | | | Properties233!PARSE-TREE: | | | | | OmpTraitProperty -> OmpTraitPropertyName -> string = 'amd'234!PARSE-TREE: | | OmpDirectiveSpecification235!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare simd236!PARSE-TREE: | | | OmpClauseList ->237!PARSE-TREE: | OmpClause -> When -> OmpWhenClause238!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector239!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User240!PARSE-TREE: | | | OmpTraitSelector241!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition242!PARSE-TREE: | | | | Properties243!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'244!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant245!PARSE-TREE: | | | | | | | bool = 'true'246!PARSE-TREE: | | OmpDirectiveSpecification247!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare target248!PARSE-TREE: | | | OmpClauseList ->249!PARSE-TREE: | OmpClause -> Otherwise -> OmpOtherwiseClause -> OmpDirectiveSpecification250!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = nothing251!PARSE-TREE: | | OmpClauseList ->252