mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:46:05 +00:00

When a character component reference is applied to a constant array of derived type, ensure that the length of the resulting character array is properly defined. Fixes https://github.com/llvm/llvm-project/issues/123362.
12 lines
404 B
Fortran
12 lines
404 B
Fortran
! RUN: %python %S/test_folding.py %s %flang_fc1
|
|
! Ensure that array-valued component references have lengths
|
|
! (see https://github.com/llvm/llvm-project/issues/123362)
|
|
module m
|
|
type cdt
|
|
character(7) :: a = "ibm704", b = "cdc6600"
|
|
end type
|
|
type(cdt), parameter :: arr(2) = cdt()
|
|
integer, parameter :: check(*) = scan(arr%a, arr%b)
|
|
logical, parameter :: test1 = all(check == 5) ! the '0'
|
|
end
|