brintos

brintos / llvm-project-archived public Read only

0
0
Text · 927 B · cf900a5 Raw
27 lines · plain
1! Test use defined operators/assignment2! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s3 4! Test user defined assignment5! CHECK-LABEL: func @_QPuser_assignment(6! CHECK-SAME: %[[arg0:.*]]: !fir.ref<!fir.type<{{.*}}>>{{.*}}, %[[arg1:.*]]: !fir.ref<i32>{{.*}}) {7subroutine user_assignment(a, i)8  type t9    real :: x10    integer :: i11  end type12  interface assignment(=)13  subroutine my_assign(b, j)14    import :: t15    type(t), INTENT(OUT) :: b16    integer, INTENT(IN) :: j17  end subroutine18 end interface19 type(t) :: a20! CHECK: %[[V_0:[0-9]+]] = fir.alloca i3221! CHECK: %[[V_1:[0-9]+]] = fir.load %arg1 : !fir.ref<i32>22! CHECK: %[[V_2:[0-9]+]] = fir.no_reassoc %[[V_1:[0-9]+]] : i3223! CHECK: fir.store %[[V_2]] to %[[V_0:[0-9]+]] : !fir.ref<i32>24! CHECK: fir.call @_QPmy_assign(%arg0, %[[V_0]]) fastmath<contract> : (!fir.ref<!fir.type<_QFuser_assignmentTt{x:f32,i:i32}>>, !fir.ref<i32>) -> ()25 a = i26end subroutine27