| 1 |
! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp |
| 2 |
! OpenMP Version 5.0 |
| 3 |
! 2.10.1 use_device_ptr clause |
| 4 |
! List item in USE_DEVICE_ADDR clause must not be structure element. |
| 5 |
! Same list item can not be present multiple times or in multipe |
| 6 |
! USE_DEVICE_ADDR clauses. |
| 7 |
|
| 8 |
subroutine omp_target_data |
| 9 |
integer :: a(1024) |
| 10 |
integer, target :: b(1024) |
| 11 |
type my_type |
| 12 |
integer :: my_b(1024) |
| 13 |
end type my_type |
| 14 |
|
| 15 |
type(my_type) :: my_var |
| 16 |
a = 1 |
| 17 |
|
| 18 |
!ERROR: A variable that is part of another variable (structure element) cannot appear on the TARGET DATA USE_DEVICE_ADDR clause |
| 19 |
!$omp target data map(tofrom: a) use_device_addr(my_var%my_b) |
| 20 |
my_var%my_b = a |
| 21 |
!$omp end target data |
| 22 |
|
| 23 |
!ERROR: List item 'b' present at multiple USE_DEVICE_ADDR clauses |
| 24 |
!$omp target data map(tofrom: a) use_device_addr(b,b) |
| 25 |
b = a |
| 26 |
!$omp end target data |
| 27 |
|
| 28 |
!ERROR: List item 'b' present at multiple USE_DEVICE_ADDR clauses |
| 29 |
!$omp target data map(tofrom: a) use_device_addr(b) use_device_addr(b) |
| 30 |
b = a |
| 31 |
!$omp end target data |
| 32 |
|
| 33 |
end subroutine omp_target_data |