llvm-project/flang/test/Parser/continuation-before-char.f90
Leandro Lupori 0e1fa91740 [flang] Fix character initialization after continuation
The insertion of a space on a line continuation right before
a character literal was confusing TokenSequence::ToLowerCase(),
that was unable to identify the character literal as such,
causing it to be converted to lower case.

Fix this by skipping spaces in the beginning and end of each
token, before testing for token type.

Fixes https://github.com/llvm/llvm-project/issues/62039

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D151885
2023-06-01 16:48:11 -03:00

8 lines
211 B
Fortran

! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
! Continuation right before character literal.
subroutine test()
! CHECK: CHARACTER(LEN=3_4) :: a = "ABC"
character(len=3) :: a =&
"ABC"
end subroutine