File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 363
363
* Constraint C1406, which prohibits the same module name from being used
364
364
in a scope for both an intrinsic and a non-intrinsic module, is implemented
365
365
as a portability warning only, not a hard error.
366
+ * IBM @PROCESS directive is accepted but ignored.
366
367
367
368
## Preprocessing behavior
368
369
Original file line number Diff line number Diff line change @@ -777,8 +777,23 @@ bool Prescanner::PadOutCharacterLiteral(TokenSequence &tokens) {
777
777
return false ;
778
778
}
779
779
780
+ static bool IsAtProcess (const char *p) {
781
+ static const char pAtProc[]{" process" };
782
+ for (std::size_t i{0 }; i < sizeof pAtProc - 1 ; ++i) {
783
+ if (ToLowerCaseLetter (*++p) != pAtProc[i])
784
+ return false ;
785
+ }
786
+ return true ;
787
+ }
788
+
780
789
bool Prescanner::IsFixedFormCommentLine (const char *start) const {
781
790
const char *p{start};
791
+
792
+ // The @process directive must start in column 1.
793
+ if (*p == ' @' && IsAtProcess (p)) {
794
+ return true ;
795
+ }
796
+
782
797
if (IsFixedFormCommentChar (*p) || *p == ' %' || // VAX %list, %eject, &c.
783
798
((*p == ' D' || *p == ' d' ) &&
784
799
!features_.IsEnabled (LanguageFeature::OldDebugLines))) {
@@ -810,6 +825,8 @@ const char *Prescanner::IsFreeFormComment(const char *p) const {
810
825
p = SkipWhiteSpaceAndCComments (p);
811
826
if (*p == ' !' || *p == ' \n ' ) {
812
827
return p;
828
+ } else if (*p == ' @' ) {
829
+ return IsAtProcess (p) ? p : nullptr ;
813
830
} else {
814
831
return nullptr ;
815
832
}
Original file line number Diff line number Diff line change
1
+ ! RUN: %flang_fc1 - fsyntax- only %s 2 >&1 | FileCheck %s
2
+
3
+ ! Test ignoring @PROCESS directive in fixed source form
4
+
5
+ @process opt(3 )
6
+ @process opt(0 )
7
+ @process
8
+ @processopt(3 )
9
+ subroutine f ()
10
+ c @process
11
+ end
12
+
13
+ !CHECK: Character in fixed- form label field must be a digit
14
+ @
15
+
16
+ !CHECK: Character in fixed- form label field must be a digit
17
+ @proce
18
+
19
+ !CHECK: Character in fixed- form label field must be a digit
20
+ @precoss
Original file line number Diff line number Diff line change
1
+ ! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
2
+
3
+ ! Test ignoring @PROCESS directive in free source form
4
+
5
+ @process opt(3 )
6
+ @process opt(0 )
7
+ @process strict
8
+ @processopt(3 )
9
+ subroutine f ()
10
+ print * , " @process"
11
+ ! @process
12
+ end subroutine f
13
+
14
+ ! CHECK: error: expected '('
15
+ @p
16
+
17
+ ! CHECK: error: expected '('
18
+ @proce
19
+
20
+ ! CHECK: error: expected '('
21
+ @precoss
22
+ end
23
+
You can’t perform that action at this time.
0 commit comments