Files
clang-p2996/flang/test/Parser/OpenMP/taskloop.f90
Kiran Chandramohan 5621929f7f [Flang][OpenMP] Add parser support for grainsize and num_tasks clause (#113136)
These clauses are applicable only for the taskloop directive. Since the
directive has a TODO error, skipping the addition of TODOs for these
clauses.
2024-10-27 20:16:24 +00:00

42 lines
1.5 KiB
Fortran

! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
subroutine parallel_work
integer :: i
!CHECK: !$OMP TASKLOOP GRAINSIZE(STRICT:500_4)
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Grainsize -> OmpGrainsizeClause
!PARSE-TREE-NEXT: Prescriptiveness = Strict
!PARSE-TREE-NEXT: Scalar -> Integer -> Expr = '500_4'
!$omp taskloop grainsize(strict: 500)
do i=1,10000
call loop_body(i)
end do
!$omp end taskloop
!CHECK: !$OMP TASKLOOP GRAINSIZE(500_4)
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Grainsize -> OmpGrainsizeClause
!PARSE-TREE-NEXT: Scalar -> Integer -> Expr = '500_4'
!$omp taskloop grainsize(500)
do i=1,10000
call loop_body(i)
end do
!$omp end taskloop
!CHECK: !$OMP TASKLOOP NUM_TASKS(STRICT:500_4)
!PARSE-TREE: OmpBeginLoopDirective
!PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop
!PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> NumTasks -> OmpNumTasksClause
!PARSE-TREE-NEXT: Prescriptiveness = Strict
!PARSE-TREE-NEXT: Scalar -> Integer -> Expr = '500_4'
!$omp taskloop num_tasks(strict: 500)
do i=1,10000
call loop_body(i)
end do
!$omp end taskloop
end subroutine parallel_work