gcc/testsuite/gfortran.dg/gomp/allocate-12.f90
raw| 1 | module m |
| 2 | implicit none |
| 3 | contains |
| 4 | subroutine f () |
| 5 | !$omp declare target |
| 6 | integer :: var ! { dg-error "'allocate' directive for 'var' inside a target region must specify an 'allocator' clause" } |
| 7 | !$omp allocate(var) |
| 8 | var = 5 |
| 9 | end |
| 10 | |
| 11 | subroutine h () |
| 12 | !$omp target |
| 13 | !$omp parallel |
| 14 | !$omp single |
| 15 | block |
| 16 | integer :: var2(5) ! { dg-error "'allocate' directive for 'var2' inside a target region must specify an 'allocator' clause" } |
| 17 | !$omp allocate(var2) |
| 18 | var2(1) = 7 |
| 19 | end block |
| 20 | !$omp end single |
| 21 | !$omp end parallel |
| 22 | !$omp end target |
| 23 | end |
| 24 | end module |