Debian Codegraph @

gcc/testsuite/gfortran.dg/pr117901.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-O3" }
3 !
4 ! Test the fix for pr117901, in which the variable length character in
5 ! the SELECT TYPE construct caused an ICE in make_ssa_name_fn. This is
6 ! a much reduced testcase, extracted from class_transformational_1.f90.
7 ! Note that it does not have references to transformational functions
8 ! of class objects!
9 !
10 Module class_tests
11 contains
12 subroutine class_rebar (arg)
13 class(*), allocatable :: arg(:)
14 call class_bar (arg)
15 end
16 subroutine class_bar(x)
17 class(*), intent(in) :: x(..)
18 integer :: checksum
19 select rank (x)
20 rank (1)
21 select type (x)
22 type is (character(*))
23 checksum = sum(ichar(x(:)(1:1)) + ichar(x(:)(2:2)))
24 print *, checksum
25 end select
26 rank (2)
27 rank (3)
28 end select
29 end
30 end module class_tests