brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · e440d23 Raw
49 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %flang_fc1 %openmp_flags -fopenmp-version=51 -fdebug-dump-parse-tree %s | FileCheck %s4! RUN: %flang_fc1 %openmp_flags -fdebug-unparse -fopenmp-version=51 %s | FileCheck %s --check-prefix="UNPARSE"5! Ensures associated declarative OMP allocations are nested in their6! corresponding executable allocate directive7 8program allocate_align_tree9    use omp_lib10    integer, allocatable :: j(:), xarray(:)11    integer :: z, t12    t = 213    z = 314!$omp allocate(j) align(16)15!$omp allocate(xarray) align(32) allocator(omp_large_cap_mem_alloc)16    allocate(j(z), xarray(t))17end program allocate_align_tree18 19!CHECK:      DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt20!CHECK-NEXT: | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->21!CHECK-NEXT: | AttrSpec -> Allocatable22!CHECK-NEXT: | EntityDecl23!CHECK-NEXT: | | Name = 'j'24 25!CHECK:      ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective26!CHECK-NEXT: | OmpBeginDirective27!CHECK-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = allocate28!CHECK-NEXT: | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'j'29!CHECK-NEXT: | | OmpClauseList -> OmpClause -> Align -> OmpAlignClause -> Scalar -> Integer -> Constant -> Expr = '16_4'30!CHECK-NEXT: | | | LiteralConstant -> IntLiteralConstant = '16'31!CHECK-NEXT: | | Flags = {}32!CHECK-NEXT: | Block33!CHECK-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective34!CHECK-NEXT: | | | OmpBeginDirective35!CHECK-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = allocate36!CHECK-NEXT: | | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'xarray'37!CHECK-NEXT: | | | | OmpClauseList -> OmpClause -> Align -> OmpAlignClause -> Scalar -> Integer -> Constant -> Expr = '32_4'38!CHECK-NEXT: | | | | | LiteralConstant -> IntLiteralConstant = '32'39!CHECK-NEXT: | | | | OmpClause -> Allocator -> Scalar -> Integer -> Expr = '2_8'40!CHECK-NEXT: | | | | | Designator -> DataRef -> Name = 'omp_large_cap_mem_alloc'41!CHECK-NEXT: | | | | Flags = {}42!CHECK-NEXT: | | | Block43!CHECK-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt44 45!UNPARSE:      !$OMP ALLOCATE(j) ALIGN(16_4)46!UNPARSE-NEXT: !$OMP ALLOCATE(xarray) ALIGN(32_4) ALLOCATOR(2_8)47!UNPARSE-NEXT:  ALLOCATE(j(z), xarray(t))48 49