1! { dg-do run }
2! { dg-options "-fbounds-check" }
3
4! PR fortran/35846
5! This used to ICE because the charlength of the trim-expression was
6! NULL.
7
8! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
9
10implicit none
11character(len=2) :: c(3)
12
13c = 'a'
14c = (/ (/ trim(c(1)), 'a' /)//'c', 'cd' /)
15
16print *, c
17
18if (c(1) /= 'ac' .or. c(2) /= 'ac' .or. c(3) /= 'cd') then
19  call abort ()
20end if
21
22end
23