77 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s2! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s3! Check unparsing of OpenMP 5.2 Allocators construct4 5subroutine allocate()6 use omp_lib7 integer, allocatable :: arr1(:), arr2(:, :)8 9 !$omp allocators allocate(omp_default_mem_alloc: arr1)10 allocate(arr1(5))11 12 !$omp allocators allocate(allocator(omp_default_mem_alloc), align(32): arr1) &13 !$omp allocate(omp_default_mem_alloc: arr2)14 allocate(arr1(10), arr2(3, 2))15 16 !$omp allocators allocate(align(32): arr2)17 allocate(arr2(5, 3))18 !$omp end allocators19end subroutine allocate20 21!CHECK: INTEGER, ALLOCATABLE :: arr1(:), arr2(:,:)22!CHECK-NEXT:!$OMP ALLOCATORS ALLOCATE(omp_default_mem_alloc: arr1)23!CHECK-NEXT: ALLOCATE(arr1(5))24!CHECK-NEXT:!$OMP ALLOCATORS ALLOCATE(ALLOCATOR(omp_default_mem_alloc), ALIGN(32): arr1) A&25!CHECK-NEXT:!$OMP&LLOCATE(omp_default_mem_alloc: arr2)26!CHECK-NEXT: ALLOCATE(arr1(10), arr2(3,2))27!CHECK-NEXT:!$OMP ALLOCATORS ALLOCATE(ALIGN(32): arr2)28!CHECK-NEXT: ALLOCATE(arr2(5,3))29 30!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAllocatorsConstruct31!PARSE-TREE-NEXT: | OmpBeginDirective32!PARSE-TREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = allocators33!PARSE-TREE-NEXT: | | OmpClauseList -> OmpClause -> Allocate -> OmpAllocateClause34!PARSE-TREE-NEXT: | | | Modifier -> OmpAllocatorSimpleModifier -> Scalar -> Integer -> Expr -> Designator -> DataRef -> Name = 'omp_default_mem_alloc'35!PARSE-TREE-NEXT: | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'arr1'36!PARSE-TREE-NEXT: | | Flags = {}37!PARSE-TREE-NEXT: | Block38!PARSE-TREE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt39!PARSE-TREE-NEXT: | | | Allocation40!PARSE-TREE-NEXT: | | | | AllocateObject -> Name = 'arr1'41 42!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAllocatorsConstruct43!PARSE-TREE-NEXT: | OmpBeginDirective44!PARSE-TREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = allocators45!PARSE-TREE-NEXT: | | OmpClauseList -> OmpClause -> Allocate -> OmpAllocateClause46!PARSE-TREE-NEXT: | | | Modifier -> OmpAllocatorComplexModifier -> Scalar -> Integer -> Expr -> Designator -> DataRef -> Name = 'omp_default_mem_alloc'47!PARSE-TREE-NEXT: | | | Modifier -> OmpAlignModifier -> Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '32'48!PARSE-TREE-NEXT: | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'arr1'49!PARSE-TREE-NEXT: | | OmpClause -> Allocate -> OmpAllocateClause50!PARSE-TREE-NEXT: | | | Modifier -> OmpAllocatorSimpleModifier -> Scalar -> Integer -> Expr -> Designator -> DataRef -> Name = 'omp_default_mem_alloc'51!PARSE-TREE-NEXT: | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'arr2'52!PARSE-TREE-NEXT: | | Flags = {}53!PARSE-TREE-NEXT: | Block54!PARSE-TREE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt55!PARSE-TREE-NEXT: | | | Allocation56!PARSE-TREE-NEXT: | | | | AllocateObject -> Name = 'arr1'57 58!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAllocatorsConstruct59!PARSE-TREE-NEXT: | OmpBeginDirective60!PARSE-TREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = allocators61!PARSE-TREE-NEXT: | | OmpClauseList -> OmpClause -> Allocate -> OmpAllocateClause62!PARSE-TREE-NEXT: | | | Modifier -> OmpAlignModifier -> Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '32'63!PARSE-TREE-NEXT: | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'arr2'64!PARSE-TREE-NEXT: | | Flags = {}65!PARSE-TREE-NEXT: | Block66!PARSE-TREE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt67!PARSE-TREE-NEXT: | | | Allocation68!PARSE-TREE-NEXT: | | | | AllocateObject -> Name = 'arr2'69!PARSE-TREE-NEXT: | | | | AllocateShapeSpec70!PARSE-TREE-NEXT: | | | | | Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '5'71!PARSE-TREE-NEXT: | | | | AllocateShapeSpec72!PARSE-TREE-NEXT: | | | | | Scalar -> Integer -> Expr -> LiteralConstant -> IntLiteralConstant = '3'73!PARSE-TREE-NEXT: | OmpEndDirective74!PARSE-TREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = allocators75!PARSE-TREE-NEXT: | | OmpClauseList ->76!PARSE-TREE-NEXT: | | Flags = {}77