brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 23c1c74 Raw
37 lines · plain
1! Test that private component names are mangled inside fir.record2! in a way that allow components with the same name to be added in3! type extensions.4! RUN: bbc -emit-hlfir -o - %s | FileCheck %s5 6module name_clash7  type:: t8    integer, private :: i9  end type10  type(t), parameter :: cst = t(42)11end module12 13!CHECK-LABEL: func.func @_QPuser_clash(14!CHECK-SAME: !fir.ref<!fir.type<_QFuser_clashTt2{t:!fir.type<_QMname_clashTt{_QMname_clashTt.i:i32}>,i:i32}>>15!CHECK-SAME: !fir.ref<!fir.type<_QMname_clashTt{_QMname_clashTt.i:i32}>>16subroutine user_clash(a, at)17  use name_clash18  type,extends(t) :: t219    integer :: i = 220  end type21  type(t2) :: a, b22  type(t) :: at23  print *, a%i24  print *, t2(t=at)25  a = b26end subroutine27 28! CHECK-LABEL: func.func @_QPclash_with_intrinsic_module(29! CHECK-SAME: !fir.ref<!fir.type<_QFclash_with_intrinsic_moduleTmy_class{ieee_class_type:!fir.type<_QMieee_arithmeticTieee_class_type{_QMieee_arithmeticTieee_class_type.which:i8}>,which:i8}>>30subroutine clash_with_intrinsic_module(a)31 use ieee_arithmetic32 type, extends(ieee_class_type) :: my_class33    integer(1) :: which34 end type35 type(my_class) :: a36end subroutine37