Peter Klausler 0d64801bc3
[flang] Recognize compiler directives after expansion in comment (#180062)
The compiler can recognize a compiler directive when one results from a
macro expansion at the beginning of a non-comment source line, as in
"#define FOO !$OMP". But it can't recognize a compiler directive that
initially appears as a comment line, as in "!BAR" after "#define BAR
$OMP". Extend the prescanner to recognize such cases in free form
source. (Fixed form is a much more complicated case for this recognition
and will be addressed later if needed.)

Fixes https://github.com/llvm/llvm-project/issues/178481.
2026-02-10 09:20:57 -08:00

8 lines
181 B
Fortran

!RUN: %flang_fc1 -fdebug-unparse -fopenmp %s 2>&1 | FileCheck %s
!CHECK: !$OMP DECLARE TARGET
#define OMP_DECLARE_TARGET $OMP declare target
subroutine s
!OMP_DECLARE_TARGET
end