65 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %flang_fc1 %openmp_flags -fdebug-dump-parse-tree %s | FileCheck %s4! Ensures associated declarative OMP allocations in the specification5! part are kept there6 7program allocate_tree8 use omp_lib9 integer, allocatable :: w, xarray(:), zarray(:, :)10 integer :: f11!$omp allocate(f) allocator(omp_default_mem_alloc)12 f = 213!$omp allocate(w) allocator(omp_const_mem_alloc)14!$omp allocate(xarray) allocator(omp_large_cap_mem_alloc)15!$omp allocate(zarray) allocator(omp_default_mem_alloc)16!$omp allocate17 allocate (w, xarray(4), zarray(5, f))18end program allocate_tree19 20!CHECK: | | DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpAllocateDirective21!CHECK-NEXT: | | | OmpBeginDirective22!CHECK-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = allocate23!CHECK-NEXT: | | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'f'24!CHECK-NEXT: | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_8'25!CHECK-NEXT: | | | | | Designator -> DataRef -> Name = 'omp_default_mem_alloc'26!CHECK-NEXT: | | | | Flags = {}27!CHECK-NEXT: | | | Block28!CHECK-NEXT: | ExecutionPart -> Block29!CHECK-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt = 'f=2_4'30!CHECK-NEXT: | | | Variable = 'f'31!CHECK-NEXT: | | | | Designator -> DataRef -> Name = 'f'32!CHECK-NEXT: | | | Expr = '2_4'33!CHECK-NEXT: | | | | LiteralConstant -> IntLiteralConstant = '2'34!CHECK-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective35!CHECK-NEXT: | | | OmpBeginDirective36!CHECK-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = allocate37!CHECK-NEXT: | | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'w'38!CHECK-NEXT: | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '3_8'39!CHECK-NEXT: | | | | | Designator -> DataRef -> Name = 'omp_const_mem_alloc'40!CHECK-NEXT: | | | | Flags = {}41!CHECK-NEXT: | | | Block42!CHECK-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective43!CHECK-NEXT: | | | | | OmpBeginDirective44!CHECK-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = allocate45!CHECK-NEXT: | | | | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'xarray'46!CHECK-NEXT: | | | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '2_8'47!CHECK-NEXT: | | | | | | | Designator -> DataRef -> Name = 'omp_large_cap_mem_alloc'48!CHECK-NEXT: | | | | | | Flags = {}49!CHECK-NEXT: | | | | | Block50!CHECK-NEXT: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective51!CHECK-NEXT: | | | | | | | OmpBeginDirective52!CHECK-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = allocate53!CHECK-NEXT: | | | | | | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'zarray'54!CHECK-NEXT: | | | | | | | | OmpClauseList -> OmpClause -> Allocator -> Scalar -> Integer -> Expr = '1_8'55!CHECK-NEXT: | | | | | | | | | Designator -> DataRef -> Name = 'omp_default_mem_alloc'56!CHECK-NEXT: | | | | | | | | Flags = {}57!CHECK-NEXT: | | | | | | | Block58!CHECK-NEXT: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpAllocateDirective59!CHECK-NEXT: | | | | | | | | | OmpBeginDirective60!CHECK-NEXT: | | | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = allocate61!CHECK-NEXT: | | | | | | | | | | OmpClauseList ->62!CHECK-NEXT: | | | | | | | | | | Flags = {}63!CHECK-NEXT: | | | | | | | | | Block64!CHECK-NEXT: | | | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt65