File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ ! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s
2+
3+ module symbols
4+ integer(4), device, target :: sdev(100)
5+ end module
6+
7+ subroutine sub1
8+ use iso_c_binding
9+ use symbols
10+ print*, c_loc(sdev)
11+ end subroutine
12+
13+ ! CHECK-LABEL: func.func @_QPsub1()
14+ ! CHECK: %[[ADDR:.*]] = fir.address_of(@_QMsymbolsEsdev) : !fir.ref<!fir.array<100xi32>>
15+ ! CHECK: %[[EMBOX:.*]] = fir.embox %[[ADDR]](%{{.*}}) : (!fir.ref<!fir.array<100xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<100xi32>>
16+ ! CHECK: %[[__ADDRESS:.*]] = fir.coordinate_of %{{.*}}, __address : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) -> !fir.ref<i64>
17+ ! CHECK: %[[BOX_ADDR:.*]] = fir.box_addr %[[EMBOX]] : (!fir.box<!fir.array<100xi32>>) -> !fir.ref<!fir.array<100xi32>>
18+ ! CHECK: %[[CONV:.*]] = fir.convert %[[BOX_ADDR]] : (!fir.ref<!fir.array<100xi32>>) -> i64
19+ ! CHECK: fir.store %[[CONV]] to %[[__ADDRESS]] : !fir.ref<i64>
You can’t perform that action at this time.
0 commit comments