view gcc/testsuite/gfortran.dg/result_in_spec_3.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-std=gnu -Wreturn-type" }
! PR fortran/34248
!
! There was an ICE for assumed-length functions
! if RESULT(...) was used and no value assigned
! to the result variable.
!
character(*) FUNCTION test() RESULT(ctab)
  ctab = "Hello"
END function test

FUNCTION test2() RESULT(res)      ! { dg-warning "not set" }
  character(*) :: res
END function test2