| 1 |
! { dg-do compile } |
| 2 |
|
| 3 |
! PR fortran/110725 |
| 4 |
! PR middle-end/71065 |
| 5 |
|
| 6 |
implicit none |
| 7 |
integer :: x |
| 8 |
!$omp target device(1) |
| 9 |
block |
| 10 |
!$omp teams num_teams(f()) |
| 11 |
!$omp end teams |
| 12 |
end block |
| 13 |
!!$omp end target |
| 14 |
|
| 15 |
!$omp target device(1) |
| 16 |
!$omp teams num_teams(f()) |
| 17 |
!$omp end teams |
| 18 |
!$omp end target |
| 19 |
|
| 20 |
!$omp target device(1) ! { 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 |
x = 5 |
| 22 |
!$omp teams num_teams(f()) ! { 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" } |
| 23 |
!$omp end teams |
| 24 |
!$omp end target |
| 25 |
|
| 26 |
!$omp target device(1) ! { 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" } |
| 27 |
!$omp teams num_teams(f()) ! { 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" } |
| 28 |
!$omp end teams |
| 29 |
x = 5 |
| 30 |
!$omp end target |
| 31 |
|
| 32 |
!$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" } |
| 33 |
block |
| 34 |
block |
| 35 |
!$omp teams num_teams(f()) |
| 36 |
!$omp end teams |
| 37 |
end block |
| 38 |
end block |
| 39 |
!$omp end target |
| 40 |
|
| 41 |
!$omp target device(1) ! { 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" } |
| 42 |
block |
| 43 |
x = 5 |
| 44 |
!$omp teams num_teams(f()) ! { 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" } |
| 45 |
!$omp end teams |
| 46 |
end block |
| 47 |
!$omp end target |
| 48 |
|
| 49 |
!$omp target device(1) ! { 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" } |
| 50 |
block |
| 51 |
!$omp teams num_teams(f()) ! { 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" } |
| 52 |
!$omp end teams |
| 53 |
x = 5 |
| 54 |
end block |
| 55 |
!$omp end target |
| 56 |
|
| 57 |
!$omp target device(1) ! { 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 |
block |
| 59 |
!$omp teams num_teams(f()) ! { 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" } |
| 60 |
!$omp end teams |
| 61 |
x = 5 |
| 62 |
end block |
| 63 |
!$omp end target |
| 64 |
|
| 65 |
!$omp target device(1) ! { 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" } |
| 66 |
!$omp teams num_teams(f()) ! { 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" } |
| 67 |
!$omp end teams |
| 68 |
block; end block |
| 69 |
!$omp end target |
| 70 |
|
| 71 |
!$omp target device(1) ! { 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" } |
| 72 |
block |
| 73 |
block; end block; |
| 74 |
!$omp teams num_teams(f()) ! { 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" } |
| 75 |
!$omp end teams |
| 76 |
end block |
| 77 |
!$omp end target |
| 78 |
|
| 79 |
!$omp target device(1) ! { 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" } |
| 80 |
block |
| 81 |
!$omp teams num_teams(f()) ! { 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" } |
| 82 |
!$omp end teams |
| 83 |
block; end block; |
| 84 |
end block |
| 85 |
!!$omp end target |
| 86 |
|
| 87 |
|
| 88 |
contains |
| 89 |
|
| 90 |
function f() |
| 91 |
!$omp declare target |
| 92 |
integer, allocatable :: f |
| 93 |
f = 5 |
| 94 |
end |
| 95 |
end |
| 96 |
|
| 97 |
subroutine sub1 |
| 98 |
implicit none |
| 99 |
integer :: x,i |
| 100 |
|
| 101 |
!$omp target device(1) ! { 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" } |
| 102 |
block |
| 103 |
!$omp teams distribute num_teams(f()) ! { 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" } |
| 104 |
do i = 1, 5 |
| 105 |
end do |
| 106 |
x = 7 |
| 107 |
end block |
| 108 |
!$omp end target |
| 109 |
|
| 110 |
!$omp target device(1) ! { 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" } |
| 111 |
block |
| 112 |
!$omp teams loop num_teams(f()) ! { 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" } |
| 113 |
do i = 1, 5 |
| 114 |
end do |
| 115 |
x = 7 |
| 116 |
end block |
| 117 |
!$omp end target |
| 118 |
|
| 119 |
!$omp target device(1) ! { 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" } |
| 120 |
!$omp teams distribute simd num_teams(f()) ! { 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" } |
| 121 |
do i = 1, 5 |
| 122 |
end do |
| 123 |
x = 7 |
| 124 |
!$omp end target |
| 125 |
|
| 126 |
!$omp target device(1) ! { 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" } |
| 127 |
!$omp teams distribute parallel do num_teams(f()) ! { 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" } |
| 128 |
do i = 1, 5 |
| 129 |
end do |
| 130 |
x = 7 |
| 131 |
!$omp end target |
| 132 |
|
| 133 |
!$omp target device(1) ! { 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" } |
| 134 |
block |
| 135 |
x = 7 |
| 136 |
!$omp teams distribute parallel do simd num_teams(f()) ! { 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" } |
| 137 |
do i = 1, 5 |
| 138 |
end do |
| 139 |
end block |
| 140 |
!$omp end target |
| 141 |
|
| 142 |
contains |
| 143 |
|
| 144 |
function f() |
| 145 |
!$omp declare target |
| 146 |
integer, allocatable :: f |
| 147 |
f = 5 |
| 148 |
end |
| 149 |
|
| 150 |
end |