brintos

brintos / llvm-project-archived public Read only

0
0
Text · 748 B · 8edcdee Raw
30 lines · plain
1! Test lowering of derived type with private attribute2! RUN: bbc -emit-hlfir %s -o - | FileCheck %s3 4program main5  call test02()6  print *,"pass"7end program main8 9module mod210  type,private:: tt11     integer :: ip = 112  end type tt13  type,extends(tt):: ty114  ! CHECK: fir.global @_QMmod2Estr : !fir.type<_QMmod2Tty1{_QMmod2Tty1.tt:!fir.type<_QMmod2Ttt{ip:i32}>,i1:i32,i1p:!fir.type<_QMmod2Ttt{ip:i32}>,i1a:!fir.box<!fir.heap<!fir.array<?xi32>>>}>15     integer :: i1 = 116     type(tt) :: i1p = tt(2)17     integer,allocatable :: i1a(:)18  end type ty119  type(ty1) :: str20end module mod221 22subroutine test02()23  use mod224  integer,allocatable :: ia(:)25  allocate(ia(10))26  ia=227  str=ty1(i1a=ia)28  if (str%i1.ne.1) print *,'ng'29end subroutine test0230