| 1 |
! Test invalid usages of the if_present clause. |
| 2 |
|
| 3 |
subroutine t1 |
| 4 |
implicit none |
| 5 |
!$acc routine gang if_present ! { dg-error "Failed to match clause" } |
| 6 |
integer a, b, c(10) |
| 7 |
real, allocatable :: x, y, z(:) |
| 8 |
|
| 9 |
a = 5 |
| 10 |
b = 10 |
| 11 |
c(:) = -1 |
| 12 |
|
| 13 |
allocate (x, y, z(100)) |
| 14 |
|
| 15 |
!$acc enter data copyin(a) if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 16 |
!$acc exit data copyout(a) if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 17 |
|
| 18 |
!$acc data copy(a) if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 19 |
!$acc end data ! { dg-error "Unexpected ..ACC END DATA statement" } |
| 20 |
|
| 21 |
!$acc declare link(a) if_present ! { dg-error "Unexpected junk after" } |
| 22 |
|
| 23 |
!$acc init if_present ! { dg-error "Unclassifiable OpenACC directive" } |
| 24 |
!$acc shutdown if_present ! { dg-error "Unclassifiable OpenACC directive" } |
| 25 |
|
| 26 |
!$acc update self(a) device_type(nvidia) device(b) if_present ! { dg-error "Failed to match clause" } |
| 27 |
end subroutine t1 |
| 28 |
|
| 29 |
subroutine t2 |
| 30 |
implicit none |
| 31 |
integer a, b, c(10) |
| 32 |
|
| 33 |
a = 5 |
| 34 |
b = 10 |
| 35 |
c(:) = -1 |
| 36 |
|
| 37 |
!$acc parallel |
| 38 |
!$acc loop if_present ! { dg-error "Failed to match clause" } |
| 39 |
do b = 1, 10 |
| 40 |
end do |
| 41 |
!$acc end parallel |
| 42 |
|
| 43 |
!$acc kernels loop if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 44 |
do b = 1, 10 |
| 45 |
end do |
| 46 |
!$acc end kernels loop ! { dg-error "Unexpected ..ACC END KERNELS LOOP statement" } |
| 47 |
|
| 48 |
!$acc parallel loop if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 49 |
do b = 1, 10 |
| 50 |
end do |
| 51 |
!$acc end parallel loop ! { dg-error "Unexpected ..ACC END PARALLEL LOOP statement" } |
| 52 |
|
| 53 |
!$acc serial loop if_present ! { dg-error "Expected '\\(' after 'if'" } |
| 54 |
do b = 1, 10 |
| 55 |
end do |
| 56 |
!$acc end serial loop ! { dg-error "Unexpected ..ACC END SERIAL LOOP statement" } |
| 57 |
|
| 58 |
end subroutine t2 |