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