Debian Codegraph @

gcc/testsuite/gfortran.dg/pr100154.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-std=gnu" }
3 ! PR100154 - ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131
4
5 program p
6 implicit none
7 integer :: n
8 character, target :: c
9 character(len=0) :: c0
10 character(len=:), allocatable :: cc
11 n = fget(cc)
12 n = fget('a') ! { dg-error "must be a variable" }
13 n = fget(c0) ! { dg-error "must have length at least 1" }
14 call fget('x') ! { dg-error "must be a variable" }
15 n = fgetc(5,'a') ! { dg-error "must be a variable" }
16 call fgetc(5,c0) ! { dg-error "must have length at least 1" }
17 call fgetc(5,c,1) ! { dg-error "must be a variable" }
18 call fputc(5,'x',1) ! { dg-error "must be a variable" }
19 n = fget (ptr_returning_func())
20 print *, c
21 contains
22 function ptr_returning_func () result (res)
23 character, pointer :: res
24 res => c
25 end
26 end