Debian Codegraph @

gcc/testsuite/gfortran.dg/char_cons_len.f90

raw
1 ! { dg-do compile }
2 ! Tests the fix for PR24813 in which a character array
3 ! constructor, as an argument for LEN, would cause an ICE.
4 !
5 character(11) :: chr1, chr2
6 i = len ((/chr1, chr2, "ggg "/))
7 j = len ((/"abcdefghijk", chr1, chr2/))
8 k = len ((/'hello ','goodbye'/))
9 l = foo ("yes siree, Bob")
10 if (any ((/11,11,7,14/) /= (/i,j,k,l/))) STOP 1
11 contains
12 integer function foo (arg)
13 character(*) :: arg
14 character(len(arg)) :: ctor
15 foo = len ((/ctor/))
16 end function foo
17 end