re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_length_19.f90
blobe52d018b7c3e95b21569082976a9817db3eb35d4
1 ! { dg-do compile }
3 ! PR fortran/58579
5 ! Contributed by Joost VandeVondele
7 ! Was ICEing before due to the patch for PR 58593
9 subroutine test
10 CHARACTER(len=20) :: tmpStr
11 CHARACTER(len=20, kind=4) :: tmpStr4
12 INTEGER :: output_unit=6
13 WRITE (UNIT=output_unit,FMT="(T2,A,T61,A20)")&
14 "DFT| Self-interaction correction (SIC)",ADJUSTR(TRIM(tmpstr))
15 WRITE (UNIT=output_unit,FMT="(T2,A,T61,A20)")&
16 4_"DFT| Self-interaction correction (SIC)",ADJUSTR(TRIM(tmpstr4))
17 END
20 ! PR fortran/58593
21 ! Contributed by Albert Bartok
23 ! The PR was overallocating memory. I placed it here to check for a
24 ! variant of the test case above, which takes a slightly differnt code
25 ! patch. Thus, its purpose is just to ensure that it won't ICE.
27 program test_char
29 implicit none
30 integer :: i
32 read*, i
33 print*, trim(test(i))
35 contains
37 function test(i)
38 integer, intent(in) :: i
39 character(len=i) :: test
41 test(1:1) = "A"
42 endfunction test
44 endprogram test_char