brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 426f634 Raw
47 lines · plain
1! RUN: bbc -hlfir=false -o - %s | FileCheck %s2 3! CHECK-LABEL: _QPzero14subroutine zero1(z)5  real, dimension(:) :: z6  print*, size(z), z, ':'7end8 9! CHECK-LABEL: _QPzero210subroutine zero211  type dt12    integer :: j = 1713  end type14  ! CHECK: %[[z:[0-9]*]] = fir.alloca !fir.array<0x!fir.type<_QFzero2Tdt{j:i32}>> {bindc_name = "z", uniq_name = "_QFzero2Ez"}15  ! CHECK: %[[shape:[0-9]*]] = fir.shape %c0 : (index) -> !fir.shape<1>16  ! CHECK: fir.embox %[[z]](%[[shape]]) : (!fir.ref<!fir.array<0x!fir.type<_QFzero2Tdt{j:i32}>>>, !fir.shape<1>) -> !fir.box<!fir.array<0x!fir.type<_QFzero2Tdt{j:i32}>>>17  type(dt) :: z(0)18  print*, size(z), z, ':'19end20 21! CHECK-LABEL: _QPzero322subroutine zero323  type dt24    integer :: j25  end type26  ! CHECK: %[[z:[0-9]*]] = fir.address_of(@_QFzero3Ez) : !fir.ref<!fir.array<0x!fir.type<_QFzero3Tdt{j:i32}>>>27  ! CHECK: %[[shape:[0-9]*]] = fir.shape %c0 : (index) -> !fir.shape<1>28  ! CHECK: fir.embox %[[z]](%[[shape]]) : (!fir.ref<!fir.array<0x!fir.type<_QFzero3Tdt{j:i32}>>>, !fir.shape<1>) -> !fir.box<!fir.array<0x!fir.type<_QFzero3Tdt{j:i32}>>>29  type(dt) :: z(0) = dt(99)30  print*, size(z), z, ':'31end32 33! CHECK-LABEL: _QQmain34program prog35  real nada(2:-1)36  interface37    subroutine zero1(aa)38      real, dimension(:) :: aa39    end40  end interface41  ! CHECK: %[[shape:[0-9]*]] = fir.shape_shift %c2, %c0 : (index, index) -> !fir.shapeshift<1>42  ! CHECK: %2 = fir.embox %0(%[[shape]]) : (!fir.ref<!fir.array<0xf32>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<0xf32>>43  call zero1(nada)44  call zero245  call zero346end47