Skip to content

Commit bfc3d20

Browse files
committed
When calling IsCompilerDirectiveSentinel,the prefix comment character need to be skipped.
Fixes #117693
1 parent eb96c8c commit bfc3d20

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

flang/lib/Parser/prescan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ bool Prescanner::MustSkipToEndOfLine() const {
511511
if (inFixedForm_ && column_ > fixedFormColumnLimit_ && !tabInCurrentLine_) {
512512
return true; // skip over ignored columns in right margin (73:80)
513513
} else if (*at_ == '!' && !inCharLiteral_) {
514-
return !IsCompilerDirectiveSentinel(at_);
514+
return !IsCompilerDirectiveSentinel(at_+1);
515515
} else {
516516
return false;
517517
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
! RUN: %flang -fopenmp -E %s 2>&1 | FileCheck %s
2+
!CHECK: !$OMP DO SCHEDULE(STATIC)
3+
program main
4+
IMPLICIT NONE
5+
INTEGER:: I
6+
#define OMPSUPPORT
7+
!$ INTEGER :: omp_id
8+
!$OMP PARALLEL DO
9+
OMPSUPPORT !$OMP DO SCHEDULE(STATIC)
10+
DO I=1,100
11+
print *, omp_id
12+
ENDDO
13+
!$OMP END PARALLEL DO
14+
end program

0 commit comments

Comments
 (0)