1! { dg-do run } 2! { dg-options "-fbounds-check" } 3! { dg-shouldfail "Different CHARACTER lengths" } 4! PR fortran/33254: No bounds checking for array constructors 5program array_char 6implicit none 7character (len=2) :: x, y 8character (len=2) :: z(3) 9x = "a " 10y = "cd" 11z = [y(1:1), y(1:1), x(1:len(trim(x)))] ! should work 12z = [trim(x), trim(y), "aaaa"] ! [ "a", "cd", "aaaa" ] should catch first error 13end program array_char 14 15! { dg-output "Different CHARACTER lengths .1/.. in array constructor" } 16