File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ bool Prescanner::MustSkipToEndOfLine() const {
557557 return true ; // skip over ignored columns in right margin (73:80)
558558 } else if (*at_ == ' !' && !inCharLiteral_ &&
559559 (!inFixedForm_ || tabInCurrentLine_ || column_ != 6 )) {
560- return !IsCompilerDirectiveSentinel (at_);
560+ return !IsCompilerDirectiveSentinel (at_ + 1 );
561561 } else {
562562 return false ;
563563 }
Original file line number Diff line number Diff line change 1+ ! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2+
3+ ! Test that checks whether compiler directives can be inlined without mistaking it as comment.
4+
5+ module m
6+ contains
7+ #define MACRO(X) subroutine func1(X); real(2) :: X; !dir$ ignore_tkr(d) X; end subroutine func1;
8+ MACRO(foo)
9+
10+ ! CHECK: SUBROUTINE func1 (foo)
11+ ! CHECK: !DIR$ IGNORE_TKR (d) foo
12+ ! CHECK: END SUBROUTINE func1
13+
14+ subroutine func2 (foo )
15+ real (2 ) :: foo; ! dir$ ignore_tkr(d) foo;
16+ end subroutine func2
17+
18+ ! CHECK: SUBROUTINE func2 (foo)
19+ ! CHECK: !DIR$ IGNORE_TKR (d) foo
20+ ! CHECK: END SUBROUTINE func2
21+
22+ subroutine func3 (foo )
23+ real (2 ) :: foo; ! dir$ ignore_tkr(d) foo; end subroutine func3;
24+
25+ ! CHECK: SUBROUTINE func3 (foo)
26+ ! CHECK: !DIR$ IGNORE_TKR (d) foo
27+ ! CHECK: END SUBROUTINE func3
28+
29+ end module
You can’t perform that action at this time.
0 commit comments