While these testcases are dg-do compile only, I think it is better not to
give users bad examples and avoid unnecessary data races in testcases (unless
it is exactly what we want to test). Perhaps one day we'll do some analysis
and warn about data races...
2021-10-21 Jakub Jelinek <jakub@redhat.com>
* gfortran.dg/gomp/strictly-structured-block-1.f90: Use call do_work
instead of x = x + 1 in places where the latter could be a data race.
* gfortran.dg/gomp/strictly-structured-block-2.f90: Likewise.
* gfortran.dg/gomp/strictly-structured-block-3.f90: Likewise.
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp end parallel
!$omp teams
block
- x = x + 1
+ call do_work
end block
!$omp teams
block
- x = x + 1
+ call do_work
end block
!$omp end teams
!$omp scope
block
- x = x + 1
+ call do_work
end block
!$omp scope
block
- x = x + 1
+ call do_work
end block
!$omp end scope
!$omp task
block
- x = x + 1
+ call do_work
end block
!$omp task
block
- x = x + 1
+ call do_work
end block
!$omp end task
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
!$omp end target parallel
!$omp target teams
block
- x = x + 1
+ call do_work
end block
!$omp target teams
block
- x = x + 1
+ call do_work
end block
!$omp end target teams
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
end do
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
!$omp end ordered
end do
!$omp parallel
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end parallel ! { dg-error "Unexpected !.OMP END PARALLEL statement" }
!$omp teams
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end teams ! { dg-error "Unexpected !.OMP END TEAMS statement" }
!$omp masked
!$omp scope
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end scope ! { dg-error "Unexpected !.OMP END SCOPE statement" }
!$omp single
!$omp task
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end task ! { dg-error "Unexpected !.OMP END TASK statement" }
!$omp target data map(x)
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end target parallel ! { dg-error "Unexpected !.OMP END TARGET PARALLEL statement" }
!$omp target teams
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end target teams ! { dg-error "Unexpected !.OMP END TARGET TEAMS statement" }
!$omp critical
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end ordered ! { dg-error "Unexpected !.OMP END ORDERED statement" }
end do
!$omp parallel
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp end parallel
!$omp end parallel
end block
x = x + 2
!$omp section
- x = x + 4
+ call do_work
end block
!$omp sections