| 1 |
module main |
| 2 |
use iso_c_binding, only: c_funptr |
| 3 |
implicit none |
| 4 |
contains |
| 5 |
|
| 6 |
subroutine f1 () |
| 7 |
integer :: a, b, arr(10) |
| 8 |
real :: x |
| 9 |
complex :: c |
| 10 |
character :: ch |
| 11 |
logical :: bool |
| 12 |
type :: struct |
| 13 |
integer :: a |
| 14 |
real :: b |
| 15 |
end type |
| 16 |
type(struct) :: s |
| 17 |
type(c_funptr) :: p |
| 18 |
|
| 19 |
interface |
| 20 |
subroutine f0 (a, c, bool, s) |
| 21 |
import :: struct |
| 22 |
integer, intent(in) :: a |
| 23 |
complex, intent(out) :: c |
| 24 |
logical, intent(inout) :: bool |
| 25 |
type(struct) :: s |
| 26 |
end subroutine |
| 27 |
integer function f2 (arr, x, ch, b) |
| 28 |
integer, intent(inout) :: arr(:) |
| 29 |
real, intent(in) :: x |
| 30 |
character, intent(out) :: ch |
| 31 |
real :: b |
| 32 |
end function |
| 33 |
end interface |
| 34 |
procedure(f0), pointer:: fp => NULL() |
| 35 |
|
| 36 |
!$omp dispatch !{ dg-error "'OMP DISPATCH' directive at .1. must be followed by a procedure call with optional assignment" } |
| 37 |
50 b = f2(arr, x, ch, s%b) + a |
| 38 |
!$omp dispatch !{ dg-error "'OMP DISPATCH' directive at .1. must be followed by a procedure call with optional assignment" } |
| 39 |
a = b |
| 40 |
!$omp dispatch !{ dg-error "'OMP DISPATCH' directive at .1. must be followed by a procedure call with optional assignment" } |
| 41 |
b = Not (2) |
| 42 |
!$omp dispatch |
| 43 |
!$omp threadprivate(a) !{ dg-error "'OMP DISPATCH' directive must be followed by a procedure call with optional assignment at .1." } |
| 44 |
a = f2(arr, x, ch, s%b) |
| 45 |
!$omp dispatch |
| 46 |
print *, 'This is not allowed here.' !{ dg-error "'OMP DISPATCH' directive must be followed by a procedure call with optional assignment at .1." } |
| 47 |
!$omp dispatch |
| 48 |
goto 50 !{ dg-error "'OMP DISPATCH' directive must be followed by a procedure call with optional assignment at .1." } |
| 49 |
!$omp dispatch !{ dg-error "'OMP DISPATCH' directive at .1. cannot be followed by a procedure pointer" } |
| 50 |
call fp(a, c, bool, s) |
| 51 |
|
| 52 |
!$omp dispatch nocontext(s) !{ dg-error "NOCONTEXT clause at .1. requires a scalar LOGICAL expression" } |
| 53 |
call f0(a, c, bool, s) |
| 54 |
!$omp dispatch nocontext(a, b) !{ dg-error "Invalid expression after 'nocontext.' at .1." } |
| 55 |
call f0(a, c, bool, s) |
| 56 |
!$omp dispatch nocontext(a) nocontext(b) !{ dg-error "Duplicated 'nocontext' clause at .1." } |
| 57 |
call f0(a, c, bool, s) |
| 58 |
!$omp dispatch novariants(s) !{ dg-error "NOVARIANTS clause at .1. requires a scalar LOGICAL expression" } |
| 59 |
call f0(a, c, bool, s) |
| 60 |
!$omp dispatch novariants(a, b) !{ dg-error "Invalid expression after 'novariants.' at .1." } |
| 61 |
call f0(a, c, bool, s) |
| 62 |
!$omp dispatch novariants(a) novariants(b) !{ dg-error "Duplicated 'novariants' clause at .1." } |
| 63 |
call f0(a, c, bool, s) |
| 64 |
!$omp dispatch nowait nowait !{ dg-error "Duplicated 'nowait' clause at .1." } |
| 65 |
call f0(a, c, bool, s) |
| 66 |
!$omp dispatch device(x) !{ dg-error "DEVICE clause at .1. requires a scalar INTEGER expression" } |
| 67 |
call f0(a, c, bool, s) |
| 68 |
!$omp dispatch device(arr) !{ dg-error "DEVICE clause at .1. requires a scalar INTEGER expression" } |
| 69 |
call f0(a, c, bool, s) |
| 70 |
!$omp dispatch is_device_ptr(x) !{ dg-error "List item 'x' in IS_DEVICE_PTR clause at .1. must be of TYPE.C_PTR." } |
| 71 |
call f0(a, c, bool, s) |
| 72 |
!$omp dispatch is_device_ptr(arr) !{ dg-error "List item 'arr' in IS_DEVICE_PTR clause at .1. must be of TYPE.C_PTR." } |
| 73 |
call f0(a, c, bool, s) |
| 74 |
!$omp dispatch is_device_ptr(p) !{ dg-error "List item 'p' in IS_DEVICE_PTR clause at .1. must be of TYPE.C_PTR." } |
| 75 |
call f0(a, c, bool, s) |
| 76 |
!$omp dispatch depend(inout: f0) !{ dg-error "Object 'f0' is not a variable at .1." } |
| 77 |
call f0(a, c, bool, s) |
| 78 |
end subroutine |
| 79 |
end module |