[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Parser / omp-in-reduction-clause.f90
blob16f045771d732cde8c9a08537d52ff8b7c38f99f
1 ! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
2 ! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
4 ! Check for IN_REDUCTION() clause on OpenMP constructs
6 subroutine omp_in_reduction_taskgroup()
7 integer :: z, i
8 !CHECK: !$OMP TASKGROUP TASK_REDUCTION(+:z)
9 !$omp taskgroup task_reduction(+:z)
10 !CHECK-NEXT: !$OMP TASK IN_REDUCTION(+:z)
11 !$omp task in_reduction(+:z)
12 !CHECK-NEXT: z=z+5_4
13 z = z + 5
14 !CHECK-NEXT: !$OMP END TASK
15 !$omp end task
17 !CHECK-NEXT: !$OMP TASKLOOP IN_REDUCTION(+:z)
18 !$omp taskloop in_reduction(+:z)
19 !CHECK-NEXT: DO i=1_4,10_4
20 do i=1,10
21 !CHECK-NEXT: z=5_4*z
22 z = z * 5
23 !CHECK-NEXT: END DO
24 end do
25 !CHECK-NEXT: !$OMP END TASKLOOP
26 !$omp end taskloop
27 !CHECK-NEXT: !$OMP END TASKGROUP
28 !$omp end taskgroup
29 end subroutine omp_in_reduction_taskgroup
31 !PARSE-TREE: OpenMPConstruct -> OpenMPBlockConstruct
32 !PARSE-TREE-NEXT: OmpBeginBlockDirective
33 !PARSE-TREE-NEXT: OmpBlockDirective -> llvm::omp::Directive = taskgroup
34 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> TaskReduction -> OmpReductionClause
36 !PARSE-TREE: OpenMPConstruct -> OpenMPBlockConstruct
37 !PARSE-TREE-NEXT: OmpBeginBlockDirective
38 !PARSE-TREE-NEXT: OmpBlockDirective -> llvm::omp::Directive = task
39 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> InReduction -> OmpInReductionClause
40 !PARSE-TREE-NEXT: OmpReductionOperator -> DefinedOperator -> IntrinsicOperator = Add
41 !PARSE-TREE-NEXT: OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z'
43 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
44 !PARSE-TREE-NEXT: OmpBeginLoopDirective
45 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop
46 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> InReduction -> OmpInReductionClause
47 !PARSE-TREE-NEXT: OmpReductionOperator -> DefinedOperator -> IntrinsicOperator = Add
48 !PARSE-TREE-NEXT: OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z'
50 subroutine omp_in_reduction_parallel()
51 integer :: z
52 !CHECK: !$OMP PARALLEL REDUCTION(+:z)
53 !$omp parallel reduction(+:z)
54 !CHECK-NEXT: !$OMP TASKLOOP SIMD IN_REDUCTION(+:z)
55 !$omp taskloop simd in_reduction(+:z)
56 !CHECK-NEXT: DO i=1_4,10_4
57 do i=1,10
58 !CHECK-NEXT: z=5_4*z
59 z = z * 5
60 !CHECK-NEXT: END DO
61 end do
62 !CHECK-NEXT: !$OMP END TASKLOOP SIMD
63 !$omp end taskloop simd
64 !CHECK-NEXT: !$OMP END PARALLEL
65 !$omp end parallel
66 end subroutine omp_in_reduction_parallel
68 !PARSE-TREE: OpenMPConstruct -> OpenMPBlockConstruct
69 !PARSE-TREE-NEXT: OmpBeginBlockDirective
70 !PARSE-TREE-NEXT: OmpBlockDirective -> llvm::omp::Directive = parallel
71 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
73 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
74 !PARSE-TREE-NEXT: OmpBeginLoopDirective
75 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop simd
76 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> InReduction -> OmpInReductionClause
77 !PARSE-TREE-NEXT: OmpReductionOperator -> DefinedOperator -> IntrinsicOperator = Add
78 !PASRE-TREE-NEXT: OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z'