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()
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)
14 !CHECK-NEXT: !$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
25 !CHECK-NEXT: !$OMP END TASKLOOP
27 !CHECK-NEXT: !$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()
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
62 !CHECK-NEXT: !$OMP END TASKLOOP SIMD
63 !$omp end taskloop simd
64 !CHECK-NEXT: !$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'