[flang][preprocessor] Directive continuation must skip empty macros (#134149)
When a compiler directive continuation line starts with keyword macro names that have empty expansions, skip them.
This commit is contained in:
parent
efd7caac2e
commit
507ce46b6f
@ -1325,7 +1325,7 @@ const char *Prescanner::FreeFormContinuationLine(bool ampersand) {
|
|||||||
if (p >= limit_) {
|
if (p >= limit_) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
p = SkipWhiteSpace(p);
|
p = SkipWhiteSpaceIncludingEmptyMacros(p);
|
||||||
if (*p == '!') {
|
if (*p == '!') {
|
||||||
++p;
|
++p;
|
||||||
if (InCompilerDirective()) {
|
if (InCompilerDirective()) {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#define COMMENT !
|
#define COMMENT !
|
||||||
#define OMP_START !$omp
|
#define OMP_START !$omp
|
||||||
#define OMP_CONT !$omp&
|
#define OMP_CONT !$omp&
|
||||||
|
#define EMPTY
|
||||||
|
|
||||||
module m
|
module m
|
||||||
contains
|
contains
|
||||||
@ -50,6 +51,11 @@ OMP_CONT do &
|
|||||||
OMP_CONT reduction(+:x)
|
OMP_CONT reduction(+:x)
|
||||||
do j3 = 1, n
|
do j3 = 1, n
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
EMPTY !$omp parallel &
|
||||||
|
EMPTY !$omp do
|
||||||
|
do j4 = 1, n
|
||||||
|
end do
|
||||||
end
|
end
|
||||||
|
|
||||||
COMMENT &
|
COMMENT &
|
||||||
@ -79,6 +85,9 @@ end module
|
|||||||
!CHECK: !$OMP PARALLEL DO REDUCTION(+: x)
|
!CHECK: !$OMP PARALLEL DO REDUCTION(+: x)
|
||||||
!CHECK: DO j3=1_4,n
|
!CHECK: DO j3=1_4,n
|
||||||
!CHECK: END DO
|
!CHECK: END DO
|
||||||
|
!CHECK: !$OMP PARALLEL DO
|
||||||
|
!CHECK: DO j4=1_4,n
|
||||||
|
!CHECK: END DO
|
||||||
!CHECK: END SUBROUTINE
|
!CHECK: END SUBROUTINE
|
||||||
!CHECK: SUBROUTINE s2
|
!CHECK: SUBROUTINE s2
|
||||||
!CHECK: END SUBROUTINE
|
!CHECK: END SUBROUTINE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user