Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/libgomp/testsuite/libgomp.fortran/target-in-reduction-2.f90
2023-03-06 14:48:14 +01:00

30 lines
458 B
Fortran

! { dg-do run }
program main
integer :: x
x = 0
!$omp taskgroup task_reduction (+: x)
call foo (x)
call bar (x)
!$omp end taskgroup
if (x .ne. 3) stop 1
contains
subroutine foo (x)
integer :: x
!$omp task in_reduction (+: x)
x = x + 1
!$omp end task
end subroutine foo
subroutine bar (x)
integer :: x
!$omp target in_reduction (+: x)
x = x + 2
!$omp end target
end subroutine bar
end program main