Files
clang-p2996/flang/test/Preprocessing/preprocessed-dirs.F90
Peter Klausler 297230acda [flang] Accept directive sentinels in macro-replaced source better (#70699)
At present, the prescanner emits an error if a source line or compiler
directive, after macro replacement or not, contains a token with a
non-Fortran character. In the particular case of the '!' character, the
code that checks for bad character will accept the '!' if it appears
after a ';', since the '!' might begin a compiler directive.

This current implementation fails when a compiler directive appears
after some other character that might (by means of further source
processing not visible to the prescanner) be replaced with a ';' or
newline.

Extend the bad character check for '!' to actually check for a compiler
directive sentinel instead.
2023-10-31 12:35:01 -07:00

9 lines
244 B
Fortran

! RUN: %flang -fc1 -E -fopenacc %s 2>&1 | FileCheck %s
!CHECK: subroutine r4(x) Z real :: x Z !$acc routine Z print *, x Z end
#define SUB(s, t) subroutine s(x) Z\
t :: x Z\
!$acc routine Z\
print *, x Z\
end subroutine s
SUB(r4, real)