Files
clang-p2996/flang/test/Parser/OpenMP/task-reduction-clause.f90
Krzysztof Parzyszek 58f9c4fc00 [flang][OpenMP] Semantic checks for IN_REDUCTION and TASK_REDUCTION (#118841)
Update parsing of these two clauses and add semantic checks for them.
Simplify some code in IsReductionAllowedForType and
CheckReductionOperator.
2024-12-12 12:19:12 -06:00

24 lines
900 B
Fortran

!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=50 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=50 %s | FileCheck --check-prefix="PARSE-TREE" %s
subroutine f00
integer :: x
!$omp taskgroup task_reduction(+: x)
x = x + 1
!$omp end taskgroup
end
!UNPARSE: SUBROUTINE f00
!UNPARSE: INTEGER x
!UNPARSE: !$OMP TASKGROUP TASK_REDUCTION(+: x)
!UNPARSE: x=x+1_4
!UNPARSE: !$OMP END TASKGROUP
!UNPARSE: END SUBROUTINE
!PARSE-TREE: OmpBeginBlockDirective
!PARSE-TREE: | OmpBlockDirective -> llvm::omp::Directive = taskgroup
!PARSE-TREE: | OmpClauseList -> OmpClause -> TaskReduction -> OmpTaskReductionClause
!PARSE-TREE: | | Modifier -> OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add
!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'
!PARSE-TREE: Block