! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s module m1 type ty_device integer, device, allocatable, dimension(:) :: x end type type t1; real, device, allocatable :: a(:); end type type t2; type(t1) :: b; end type contains subroutine sub1() type(ty_device) :: a end subroutine ! CHECK-LABEL: func.func @_QMm1Psub1() ! CHECK: %[[ALLOC:.*]] = cuf.alloc !fir.type<_QMm1Tty_device{x:!fir.box>>}> {bindc_name = "a", data_attr = #cuf.cuda, uniq_name = "_QMm1Fsub1Ea"} -> !fir.ref>>}>> ! CHECK: %[[DECL:.*]]:2 = hlfir.declare %[[ALLOC]] {data_attr = #cuf.cuda, uniq_name = "_QMm1Fsub1Ea"} : (!fir.ref>>}>>) -> (!fir.ref>>}>>, !fir.ref>>}>>) ! CHECK: cuf.free %[[DECL]]#0 : !fir.ref>>}>> {data_attr = #cuf.cuda} end module program main use m1 type(ty_device) :: a type(t2) :: b end ! CHECK-LABEL: func.func @_QQmain() attributes {fir.bindc_name = "MAIN"} ! CHECK: %{{.*}} = cuf.alloc !fir.type<_QMm1Tty_device{x:!fir.box>>}> {bindc_name = "a", data_attr = #cuf.cuda, uniq_name = "_QFEa"} ! CHECK: %{{.*}} = cuf.alloc !fir.type<_QMm1Tt2{b:!fir.type<_QMm1Tt1{a:!fir.box>>}>}> {bindc_name = "b", data_attr = #cuf.cuda, uniq_name = "_QFEb"}