Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/alloc_comp_auto_array_3.f90 @ 128:fe568345ddd5
fix CbC-example
author | mir3636 |
---|---|
date | Wed, 11 Apr 2018 19:32:28 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line source
! { dg-do compile } ! { dg-options "-fdump-tree-original" } ! ! Test the fix for PR66082. The original problem was with the first ! call foo_1d. ! ! Reported by Damian Rouson <damian@sourceryinstitute.org> ! type foo_t real, allocatable :: bigarr end type block type(foo_t) :: foo allocate(foo%bigarr) call foo_1d (1,[foo]) ! wasy lost call foo_1d (1,bar_1d()) ! Check that this is OK end block contains subroutine foo_1d (n,foo) integer n type(foo_t) :: foo(n) end subroutine function bar_1d () result (array) type(foo_t) :: array(1) allocate (array(1)%bigarr) end function end ! { dg-final { scan-tree-dump-times "builtin_malloc" 3 "original" } } ! { dg-final { scan-tree-dump-times "builtin_free" 4 "original" } } ! { dg-final { scan-tree-dump-times "while \\(1\\)" 4 "original" } }