[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / flang / test / Semantics / OpenMP / use_device_addr1.f90
blobe6a3e6e5b2a2dec276e50ef9a9a1663bafd65b89
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp -fopenmp-version=50
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.
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
15 type(my_type) :: my_var
16 a = 1
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
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
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
33 end subroutine omp_target_data