Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / user-defined-operators.f90
blobb4750d5fae151f0230fe56dd14383d8afa307ced
1 ! Test use defined operators/assignment
2 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
4 ! Test user defined assignment
5 ! CHECK-LABEL: func @_QPuser_assignment(
6 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<!fir.type<{{.*}}>>{{.*}}, %[[arg1:.*]]: !fir.ref<i32>{{.*}}) {
7 subroutine user_assignment(a, i)
8 type t
9 real :: x
10 integer :: i
11 end type
12 interface assignment(=)
13 subroutine my_assign(b, j)
14 import :: t
15 type(t), INTENT(OUT) :: b
16 integer, INTENT(IN) :: j
17 end subroutine
18 end interface
19 type(t) :: a
20 ! CHECK: fir.call @_QPmy_assign(%[[arg0]], %[[arg1]])
21 a = i
22 end subroutine