! RUN: %flang_fc1 -emit-mlir %s -o - | FileCheck %s --check-prefix=BEFORE ! RUN: %flang_fc1 -emit-mlir %s -o - | fir-opt --abstract-result-on-global-opt | FileCheck %s --check-prefix=AFTER module a type f contains ! BEFORE: fir.address_of(@_QMaPfoo) : (!fir.ref>) -> !fir.box>> ! AFTER: [[ADDRESS:%.*]] = fir.address_of(@_QMaPfoo) : (!fir.ref>>>, !fir.ref>) -> () ! AFTER: fir.convert [[ADDRESS]] : ((!fir.ref>>>, !fir.ref>) -> ()) -> ((!fir.ref>) -> !fir.box>>) ! AFTER-NOT: fir.address_of(@_QMaPfoo) : (!fir.ref>) -> !fir.box>> procedure, nopass :: foo end type f contains function foo(obj) result(bar) type(f) :: obj character(len=:), allocatable :: bar if (.TRUE.) then bar = "true" else bar = "false" endif end function foo end module a program main use a type(f) :: obj print *, obj%foo(obj) end program