| 1 |
! { dg-do compile } |
| 2 |
|
| 3 |
! PR fortran/110725 |
| 4 |
! PR middle-end/71065 |
| 5 |
|
| 6 |
|
| 7 |
subroutine one |
| 8 |
!$omp target ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 9 |
block |
| 10 |
integer :: i ! <<< invalid: variable declaration |
| 11 |
!$omp teams ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 12 |
i = 5 |
| 13 |
!$omp end teams |
| 14 |
end block |
| 15 |
|
| 16 |
!$omp target ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 17 |
block |
| 18 |
type t ! <<< invalid: type declaration |
| 19 |
end type t |
| 20 |
!$omp teams ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 21 |
i = 5 |
| 22 |
!$omp end teams |
| 23 |
end block |
| 24 |
|
| 25 |
!$omp target |
| 26 |
! The following is invalid - but not detected as ST_NONE is returned: |
| 27 |
!$omp error at(compilation) severity(warning) ! { dg-warning "OMP ERROR encountered" } |
| 28 |
!$omp teams |
| 29 |
i = 5 |
| 30 |
!$omp end teams |
| 31 |
!$omp end target |
| 32 |
|
| 33 |
!$omp target |
| 34 |
! The following is invalid - but not detected as ST_NONE is returned: |
| 35 |
!$omp nothing ! <<< invalid: directive |
| 36 |
!$omp teams |
| 37 |
i = 5 |
| 38 |
!$omp end teams |
| 39 |
!$omp end target |
| 40 |
|
| 41 |
|
| 42 |
!$omp target ! { dg-error "OMP TARGET region at .1. with a nested TEAMS may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 43 |
block |
| 44 |
do i = 5, 8 |
| 45 |
!$omp teams |
| 46 |
block; end block |
| 47 |
end do |
| 48 |
end block |
| 49 |
|
| 50 |
end |
| 51 |
|
| 52 |
|
| 53 |
subroutine two |
| 54 |
!$omp target ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 55 |
block |
| 56 |
integer :: i ! <<< invalid: variable declaration |
| 57 |
!$omp teams distribute ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 58 |
do i = 1, 5 |
| 59 |
end do |
| 60 |
!$omp end teams distribute |
| 61 |
end block |
| 62 |
|
| 63 |
!$omp target ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 64 |
block |
| 65 |
type t ! <<< invalid: type declaration |
| 66 |
end type t |
| 67 |
!$omp teams distribute parallel do ! { dg-error "OMP TARGET region at .1. with a nested TEAMS at .2. may not contain any other statement, declaration or directive outside of the single TEAMS construct" } |
| 68 |
do i = 1, 5 |
| 69 |
end do |
| 70 |
end block |
| 71 |
|
| 72 |
!$omp target |
| 73 |
! The following is invalid - but not detected as ST_NONE is returned: |
| 74 |
!$omp error at(compilation) severity(warning) ! { dg-warning "OMP ERROR encountered" } |
| 75 |
!$omp teams loop |
| 76 |
do i = 5, 10 |
| 77 |
end do |
| 78 |
!$omp end target |
| 79 |
|
| 80 |
!$omp target |
| 81 |
! The following is invalid - but not detected as ST_NONE is returned: |
| 82 |
!$omp nothing ! <<< invalid: directive |
| 83 |
!$omp teams distribute simd |
| 84 |
do i = -3, 5 |
| 85 |
end do |
| 86 |
!$omp end teams distribute simd |
| 87 |
!$omp end target |
| 88 |
end |