File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -845,6 +845,9 @@ bool Prescanner::NextToken(TokenSequence &tokens) {
845845 if (InFixedFormSource ()) {
846846 SkipSpaces ();
847847 }
848+ if (inFixedForm_ && (IsOpenMPDirective () && parenthesisNesting_ > 0 )) {
849+ SkipSpaces ();
850+ }
848851 if ((*at_ == ' \' ' || *at_ == ' "' ) &&
849852 tokens.CharAt (tokens.SizeInChars () - 1 ) == ' _' ) { // kind_"..."
850853 QuotedCharacterLiteral (tokens, start);
Original file line number Diff line number Diff line change @@ -183,6 +183,9 @@ class Prescanner {
183183 bool InConditionalLine () const {
184184 return InOpenMPConditionalLine () || InOpenACCOrCUDAConditionalLine ();
185185 }
186+ bool IsOpenMPDirective () const {
187+ return directiveSentinel_ && std::strcmp (directiveSentinel_, " $omp" ) == 0 ;
188+ }
186189 bool InFixedFormSource () const {
187190 return inFixedForm_ && !inPreprocessorDirective_ && !InCompilerDirective ();
188191 }
Original file line number Diff line number Diff line change 1+ ! RUN: %flang_fc1 - fopenmp - fdebug- unparse- no- sema %s 2 >&1 | FileCheck %s
2+
3+ program name_with_space
4+ !CHECK: !$OMP THREADPRIVATE(/ cc/ , var1)
5+ !$omp threadprivate(/ c c/ , var 1 )
6+
7+ !CHECK: !$OMP PARALLEL PRIVATE(somevar,expr1,expr2) IF (expr2>expr1)
8+ !$omp parallel private(some var, expr 1 , ex pr2)
9+ !$omp+ if (exp r2 > ex pr1)
10+ !$omp critical (x_x)
11+ print ' (a)' , ' Hello World'
12+ !CHECK: !$OMP END CRITICAL(x_x)
13+ !$omp end critical (x _x)
14+ !$omp end parallel
15+ end program name_with_space
You can’t perform that action at this time.
0 commit comments