File tree Expand file tree Collapse file tree 2 files changed +34
-11
lines changed Expand file tree Collapse file tree 2 files changed +34
-11
lines changed Original file line number Diff line number Diff line change @@ -997,20 +997,27 @@ const char *Prescanner::FixedFormContinuationLine(bool mightNeedSpace) {
997
997
}
998
998
tabInCurrentLine_ = false ;
999
999
char col1{*nextLine_};
1000
- if (InCompilerDirective ()) {
1001
- // Must be a continued compiler directive.
1002
- if (!IsFixedFormCommentChar (col1)) {
1003
- return nullptr ;
1004
- }
1000
+ if (InCompilerDirective () ||
1001
+ (features_.IsEnabled (LanguageFeature::OpenMP) &&
1002
+ IsFixedFormCommentChar (col1) && nextLine_[1 ] == ' $' )) {
1005
1003
int j{1 };
1006
- for (; j < 5 ; ++j) {
1007
- char ch{directiveSentinel_[j - 1 ]};
1008
- if (ch == ' \0 ' ) {
1009
- break ;
1010
- }
1011
- if (ch != ToLowerCaseLetter (nextLine_[j])) {
1004
+ if (InCompilerDirective ()) {
1005
+ // Must be a continued compiler directive.
1006
+ if (!IsFixedFormCommentChar (col1)) {
1012
1007
return nullptr ;
1013
1008
}
1009
+ for (; j < 5 ; ++j) {
1010
+ char ch{directiveSentinel_[j - 1 ]};
1011
+ if (ch == ' \0 ' ) {
1012
+ break ;
1013
+ }
1014
+ if (ch != ToLowerCaseLetter (nextLine_[j])) {
1015
+ return nullptr ;
1016
+ }
1017
+ }
1018
+ } else {
1019
+ // Fixed Source Form Conditional Compilation Sentinels.
1020
+ j = 2 ;
1014
1021
}
1015
1022
for (; j < 5 ; ++j) {
1016
1023
if (nextLine_[j] != ' ' ) {
Original file line number Diff line number Diff line change
1
+ ! RUN: %flang_fc1 - fopenmp - fopenacc - E %s 2 >&1 | FileCheck %s
2
+ program main
3
+ ! CHECK: k01= 1+1
4
+ k01= 1 +
5
+ !$ & 1
6
+
7
+ ! CHECK: !$omp parallel
8
+ !$omp para
9
+ !$omp+ llel
10
+ !$omp end parallel
11
+
12
+ ! CHECK- NOT: comment
13
+ !$omp parallel
14
+ !$acc+ comment
15
+ !$omp end parallel
16
+ end
You can’t perform that action at this time.
0 commit comments