summaryrefslogtreecommitdiff
path: root/flang/test/Lower/user-defined-operators.f90
blob: b4750d5fae151f0230fe56dd14383d8afa307ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! Test use defined operators/assignment
! RUN: bbc -emit-fir %s -o - | FileCheck %s

! Test user defined assignment
! CHECK-LABEL: func @_QPuser_assignment(
! CHECK-SAME: %[[arg0:.*]]: !fir.ref<!fir.type<{{.*}}>>{{.*}}, %[[arg1:.*]]: !fir.ref<i32>{{.*}}) {
subroutine user_assignment(a, i)
  type t
    real :: x
    integer :: i
  end type
  interface assignment(=)
  subroutine my_assign(b, j)
    import :: t
    type(t), INTENT(OUT) :: b
    integer, INTENT(IN) :: j
  end subroutine
 end interface
 type(t) :: a
 ! CHECK: fir.call @_QPmy_assign(%[[arg0]], %[[arg1]])
 a = i
end subroutine