brintos

brintos / llvm-project-archived public Read only

0
0
Text · 902 B · 130fefa Raw
26 lines · plain
1! RUN: bbc -emit-hlfir -fcuda %S/cuda-mod.cuf2! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s3 4! Test importing module containing variable and subroutine with CUDA attributes.5 6subroutine sub1()7  use cuf_mod8!  md = 1.0 ! currently a TODO9end10 11! CHECK-LABEL: func.func @_QPsub1()12! CHECK: %[[ADDR:.*]] = fir.address_of(@_QMcuf_modEmd) : !fir.ref<f32>13! CHECK: %{{.*}}:2 = hlfir.declare %[[ADDR]] {data_attr = #cuf.cuda<device>, uniq_name = "_QMcuf_modEmd"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)14 15attributes(device) subroutine sub2()16  use cuf_mod17  call devsub()18end19 20! CHECK-LABEL: func.func @_QPsub2() attributes {cuf.proc_attr = #cuf.cuda_proc<device>}21! CHECK: fir.call @_QMcuf_modPdevsub()22 23! CHECK-LABEL: fir.global @_QMcuf_modEmd {data_attr = #cuf.cuda<device>} : f3224 25! CHECK-LABEL: func.func private @_QMcuf_modPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<device>}26