aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr81735.f90
blob: 6aae203aa0fa3275c72c940ae7561bf33058be4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { dg-do compile }
! { dg-options "-fdump-tree-original" }
!
! Contributed by Danila  <flashmozzg@gmail.com>
!
program fooprog
    implicit none
    type FooType
        integer, allocatable :: x
    end type FooType

    type(FooType), pointer :: bar

    bar => foo()

contains
    function foo() result(res)
        type(FooType), pointer :: res

        character(:), allocatable :: rt
        rt = ""
        res => null()
    end function foo
end program fooprog
! { dg-final { scan-tree-dump-times "__builtin_free" 1 "original" } }