2021-09-06 16:19:20 +08:00
! RUN: %python %S/test_errors.py %s %flang -fopenmp
2020-09-24 20:08:11 +08:00
! OpenMP Version 4.5
2021-01-15 13:42:49 +08:00
! 2.7.1 Loop Construct restrictions on single directive.
2020-09-24 20:08:11 +08:00
program omp_do
2021-01-15 13:42:49 +08:00
integer n
2021-04-09 02:33:04 +08:00
integer i , j , k
2021-01-15 13:42:49 +08:00
!$omp do
do i = 1 , 10
2021-10-30 06:09:09 +08:00
if ( i == 5 ) then
cycle
end if
2021-01-15 13:42:49 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
2020-09-24 20:08:11 +08:00
end do
!$omp end do
2021-04-30 04:12:28 +08:00
!$omp parallel do
do i = 1 , 10
2021-10-30 06:09:09 +08:00
if ( i == 9 ) then
end if
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end parallel do
!$omp parallel do simd
do i = 1 , 10
2021-10-30 06:09:09 +08:00
if ( i == 5 ) then
cycle
end if
2021-05-07 02:00:34 +08:00
!ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct and the `ORDERED` construct with the `SIMD` clause.
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end parallel do simd
!ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
!$omp distribute parallel do
do i = 1 , 10
2021-10-30 06:09:09 +08:00
if ( i == 3 ) then
cycle
end if
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end distribute parallel do
!ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
!$omp distribute parallel do simd
do i = 1 , 10
2021-10-30 06:09:09 +08:00
if ( i == 3 ) then
cycle
end if
2021-05-07 02:00:34 +08:00
!ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct and the `ORDERED` construct with the `SIMD` clause.
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end distribute parallel do simd
!$omp target parallel do
do i = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end target parallel do
!$omp target parallel do simd
do i = 1 , 10
2021-05-07 02:00:34 +08:00
!ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct and the `ORDERED` construct with the `SIMD` clause.
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end target parallel do simd
!$omp target teams distribute parallel do
do i = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end target teams distribute parallel do
2021-05-07 02:00:34 +08:00
!$omp target teams distribute parallel do simd
2021-04-30 04:12:28 +08:00
do i = 1 , 10
2021-05-07 02:00:34 +08:00
!ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct and the `ORDERED` construct with the `SIMD` clause.
2021-04-30 04:12:28 +08:00
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end target teams distribute parallel do simd
2021-04-09 02:33:04 +08:00
!$omp do
do i = 1 , 10
!$omp task
do j = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do k = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end task
end do
!$omp end do
!$omp do
do i = 1 , 10
!$omp parallel
do j = 1 , 10
!$omp single
do k = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end parallel
end do
!$omp end do
!$omp do
do i = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do j = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do k = 1 , 10
print * , "hello"
end do
!$omp end single
end do
!$omp end single
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
do k = 1 , 10
print * , "hello"
end do
!$omp end single
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp do
do k = 1 , 10
print * , "hello"
end do
!$omp end do
end do
!$omp end do
2021-01-15 13:42:49 +08:00
!$omp parallel default(shared)
!$omp do
do i = 1 , n
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
call work ( i , 1 )
!$omp end single
end do
!$omp end do
!$omp end parallel
2020-09-24 20:08:11 +08:00
2021-04-09 02:33:04 +08:00
!$omp parallel default(shared)
!$omp do
do i = 1 , n
!$omp task
do j = 1 , 10
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
!$omp single
call work ( i , 1 )
!$omp end single
end do
!$omp end task
end do
!$omp end do
!$omp end parallel
2020-09-24 20:08:11 +08:00
end program omp_do