xref: /llvm-project/flang/test/Semantics/OpenMP/use_device_addr.f90 (revision 00ab44ee66dbcf0d32819dbc6e4eefd1b7c48dfa)
1*00ab44eeSKrzysztof Parzyszek! RUN: %flang_fc1 -fopenmp -fopenmp-version=51 -fdebug-dump-symbols %s | FileCheck %s
2f85a8456SRaghu Maddhipatla! OpenMP Version 5.1
3f85a8456SRaghu Maddhipatla! 2.14.2 use_device_addr clause
4f85a8456SRaghu Maddhipatla! List item that appears in a use_device_addr clause has corresponding storage
5f85a8456SRaghu Maddhipatla! in the device data environment, references to the list item in the associated
6f85a8456SRaghu Maddhipatla! structured block are converted into references to the corresponding list item.
7f85a8456SRaghu Maddhipatla
8f85a8456SRaghu Maddhipatlasubroutine omp_target_data
9f85a8456SRaghu Maddhipatla   integer :: a(1024)
10f85a8456SRaghu Maddhipatla   !CHECK: b, TARGET size=4096 offset=4096: ObjectEntity type: INTEGER(4) shape: 1_8:1024_8
11f85a8456SRaghu Maddhipatla   integer, target :: b(1024)
12f85a8456SRaghu Maddhipatla   a = 1
13f85a8456SRaghu Maddhipatla   !$omp target data map(tofrom: a) use_device_addr(b)
14f85a8456SRaghu Maddhipatla   !CHECK: b (OmpUseDeviceAddr): HostAssoc
15f85a8456SRaghu Maddhipatla      b = a
16f85a8456SRaghu Maddhipatla   !$omp end target data
17f85a8456SRaghu Maddhipatlaend subroutine omp_target_data
18