[flang] Add -fsyntax-only to f18; retain -fparse-only synonym

Now that semantics is working, the standard -fsyntax-only option of
GNU and Clang should be used as the name of the option that causes
f18 to just run the front-end.  Support both options in f18, silently
accepting the old option as a synonym for the new one (as
preferred by the code owner), and replace all instances of the
old -fparse-only option with -fsyntax-only throughout the source base.

Differential Revision: https://reviews.llvm.org/D95887

GitOrigin-RevId: 34eb0adaa9cd76f5bb0549f5a32d6ef452fe977e
diff --git a/docs/ImplementingASemanticCheck.md b/docs/ImplementingASemanticCheck.md
index 35b107e..4a6fe13 100644
--- a/docs/ImplementingASemanticCheck.md
+++ b/docs/ImplementingASemanticCheck.md
@@ -67,7 +67,7 @@
 
 I also used this program to produce a parse tree for the program using the command:
 ```bash
-  f18 -fdebug-dump-parse-tree -fparse-only testfun.f90
+  f18 -fdebug-dump-parse-tree -fsyntax-only testfun.f90
 ```
 
 Here's the relevant fragment of the parse tree produced by the compiler:
diff --git a/docs/Overview.md b/docs/Overview.md
index 9878589..4ef04f8 100644
--- a/docs/Overview.md
+++ b/docs/Overview.md
@@ -46,7 +46,7 @@
 **Entry point:** `parser::Parsing::Parse`
 
 **Command:**
-  - `f18 -fdebug-dump-parse-tree -fparse-only src.f90` dumps the parse tree
+  - `f18 -fdebug-dump-parse-tree -fsyntax-only src.f90` dumps the parse tree
   - `f18 -funparse src.f90` converts the parse tree to normalized Fortran
 
 ## Validate Labels and Canonicalize Do Statements
@@ -74,7 +74,7 @@
 
 **Entry points:** `semantics::ResolveNames`, `semantics::RewriteParseTree`
 
-**Command:** `f18 -fdebug-dump-symbols -fparse-only src.f90` dumps the
+**Command:** `f18 -fdebug-dump-symbols -fsyntax-only src.f90` dumps the
   tree of scopes and symbols in each scope
 
 ## Check DO CONCURRENT Constraints
diff --git a/test/Evaluate/test_folding.sh b/test/Evaluate/test_folding.sh
index 81ecbea..951ef36 100755
--- a/test/Evaluate/test_folding.sh
+++ b/test/Evaluate/test_folding.sh
@@ -32,7 +32,7 @@
 mkdir -p $temp
 shift
 
-CMD="$* -fdebug-dump-symbols -fparse-only"
+CMD="$* -fdebug-dump-symbols -fsyntax-only"
 
 # Check if tests should assume folding is using libpgmath
 if [[ $LIBPGMATH ]]; then
diff --git a/test/Flang-Driver/parse-error.f95 b/test/Flang-Driver/parse-error.f95
index 84a6366..8266d04 100644
--- a/test/Flang-Driver/parse-error.f95
+++ b/test/Flang-Driver/parse-error.f95
@@ -1,5 +1,5 @@
 ! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %f18 -parse-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %f18 -syntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
 
 ! REQUIRES: new-flang-driver
 
diff --git a/test/Flang-Driver/syntax-only.f90 b/test/Flang-Driver/syntax-only.f90
index f04dd71..0eed3cc 100644
--- a/test/Flang-Driver/syntax-only.f90
+++ b/test/Flang-Driver/syntax-only.f90
@@ -1,5 +1,5 @@
 ! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! REQUIRES: new-flang-driver
 
diff --git a/test/Frontend/prescanner-diag.f90 b/test/Frontend/prescanner-diag.f90
index 4c7e6e3..2653609 100644
--- a/test/Frontend/prescanner-diag.f90
+++ b/test/Frontend/prescanner-diag.f90
@@ -6,7 +6,7 @@
 ! RUN: %flang-new -fc1 -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
 
 ! Test with -fsyntax-only (i.e. ParseSyntaxOnlyAction, stops after semantic checks)
-! RUN: %f18 -fparse-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 ! RUN: %flang-new -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 ! RUN: %flang-new -fc1 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 
diff --git a/test/Lower/pre-fir-tree01.f90 b/test/Lower/pre-fir-tree01.f90
index 6b27add..5e59ff7 100644
--- a/test/Lower/pre-fir-tree01.f90
+++ b/test/Lower/pre-fir-tree01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test structure of the Pre-FIR tree
 
diff --git a/test/Lower/pre-fir-tree02.f90 b/test/Lower/pre-fir-tree02.f90
index 2d50a93..1db4960 100644
--- a/test/Lower/pre-fir-tree02.f90
+++ b/test/Lower/pre-fir-tree02.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures all the intended nodes from the parse-tree
 ! Coarray and OpenMP related nodes are tested in other files.
diff --git a/test/Lower/pre-fir-tree03.f90 b/test/Lower/pre-fir-tree03.f90
index 1c8651b..efc923a 100644
--- a/test/Lower/pre-fir-tree03.f90
+++ b/test/Lower/pre-fir-tree03.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only -fopenmp %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only -fopenmp %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures OpenMP related constructs
 
diff --git a/test/Lower/pre-fir-tree04.f90 b/test/Lower/pre-fir-tree04.f90
index 34212fb..3f2beaf 100644
--- a/test/Lower/pre-fir-tree04.f90
+++ b/test/Lower/pre-fir-tree04.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures all the coarray related statements
 
diff --git a/test/Lower/pre-fir-tree05.f90 b/test/Lower/pre-fir-tree05.f90
index 98af5c2..3acc38b 100644
--- a/test/Lower/pre-fir-tree05.f90
+++ b/test/Lower/pre-fir-tree05.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only -fopenacc %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only -fopenacc %s | FileCheck %s
 
 ! Test structure of the Pre-FIR tree with OpenACC construct
 
diff --git a/test/Semantics/call17.f90 b/test/Semantics/call17.f90
index 1f4d2c4..ace6260 100644
--- a/test/Semantics/call17.f90
+++ b/test/Semantics/call17.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only $s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only $s 2>&1 | FileCheck %s
 
 ! Regression test: don't emit a bogus error about an invalid specification expression
 ! in the declaration of a binding
diff --git a/test/Semantics/data05.f90 b/test/Semantics/data05.f90
index a138b06..f3c7aa9 100644
--- a/test/Semantics/data05.f90
+++ b/test/Semantics/data05.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 module m
   interface
     integer function ifunc(n)
diff --git a/test/Semantics/data08.f90 b/test/Semantics/data08.f90
index 86a87f9..4040ac8 100644
--- a/test/Semantics/data08.f90
+++ b/test/Semantics/data08.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK: DATA statement value initializes 'jx' of type 'INTEGER(4)' with CHARACTER
 ! CHECK: DATA statement value initializes 'jy' of type 'INTEGER(4)' with CHARACTER
 ! CHECK: DATA statement value initializes 'jz' of type 'INTEGER(4)' with CHARACTER
diff --git a/test/Semantics/data09.f90 b/test/Semantics/data09.f90
index 1550787..4510b83 100644
--- a/test/Semantics/data09.f90
+++ b/test/Semantics/data09.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only -fdebug-dump-symbols %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -fdebug-dump-symbols %s 2>&1 | FileCheck %s
 ! CHECK: init:[INTEGER(4)::1065353216_4,1073741824_4,1077936128_4,1082130432_4]
 ! Verify that the closure of EQUIVALENCE'd symbols with any DATA
 ! initialization produces a combined initializer.
diff --git a/test/Semantics/empty.f90 b/test/Semantics/empty.f90
index e47c2e6..ff8f642 100644
--- a/test/Semantics/empty.f90
+++ b/test/Semantics/empty.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only %s
+! RUN: %f18 -fsyntax-only %s
 ! RUN: rm -rf %t && mkdir %t
 ! RUN: touch %t/empty.f90
-! RUN: %f18 -fparse-only %t/empty.f90
+! RUN: %f18 -fsyntax-only %t/empty.f90
diff --git a/test/Semantics/final02.f90 b/test/Semantics/final02.f90
index b58f91f..f613a42 100644
--- a/test/Semantics/final02.f90
+++ b/test/Semantics/final02.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fparse-only %s 2>&1 | FileCheck %s
+!RUN: %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 module m
   type :: t1
     integer :: n
diff --git a/test/Semantics/getdefinition01.f90 b/test/Semantics/getdefinition01.f90
index 57141b6..06f2cc0 100644
--- a/test/Semantics/getdefinition01.f90
+++ b/test/Semantics/getdefinition01.f90
@@ -16,12 +16,12 @@
 end module
 
 ! RUN and CHECK lines at the bottom as this test is sensitive to line numbers
-! RUN: %f18 -fget-definition 6 17 18 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 7 20 23 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
-! RUN: %f18 -fget-definition 14 3 4 -fparse-only %s | FileCheck --check-prefix=CHECK3 %s
+! RUN: %f18 -fget-definition 6 17 18 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 7 20 23 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 14 3 4 -fsyntax-only %s | FileCheck --check-prefix=CHECK3 %s
 ! CHECK1: x:{{.*}}getdefinition01.f90, 5, 21-22
 ! CHECK2: yyy:{{.*}}getdefinition01.f90, 5, 24-27
 ! CHECK3: x:{{.*}}getdefinition01.f90, 13, 24-25
 
-! RUN: not %f18 -fget-definition -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s
+! RUN: not %f18 -fget-definition -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s
 ! CHECK-ERROR: Invalid argument to -fget-definitions
diff --git a/test/Semantics/getdefinition02.f b/test/Semantics/getdefinition02.f
index ee7a967..b325369 100644
--- a/test/Semantics/getdefinition02.f
+++ b/test/Semantics/getdefinition02.f
@@ -17,9 +17,9 @@
       end module
 
 ! RUN and CHECK lines here as test is sensitive to line numbers
-! RUN: %f18 -fget-definition 7 9 10 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 8 26 29 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK2 %s
-! RUN: %f18 -fget-definition 15 9 10 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK3 %s
+! RUN: %f18 -fget-definition 7 9 10 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 8 26 29 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 15 9 10 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK3 %s
 ! CHECK1: x:{{.*}}getdefinition02.f, 5, 27-28
 ! CHECK2: yyy:{{.*}}getdefinition02.f, 5, 30-33
 ! CHECK3: x:{{.*}}getdefinition02.f, 14, 30-31
diff --git a/test/Semantics/getdefinition03-a.f90 b/test/Semantics/getdefinition03-a.f90
index ecf8c9b..6e61637 100644
--- a/test/Semantics/getdefinition03-a.f90
+++ b/test/Semantics/getdefinition03-a.f90
@@ -7,7 +7,7 @@
  x = f
 end program
 
-! RUN: %f18 -fget-definition 7 6 7 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 7 2 3 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 7 6 7 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 7 2 3 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
 ! CHECK1: f:{{.*}}getdefinition03-b.f90, 2, 12-13
 ! CHECK2: x:{{.*}}getdefinition03-a.f90, 6, 13-14
diff --git a/test/Semantics/getdefinition04.f90 b/test/Semantics/getdefinition04.f90
index 7242959..bc01f79 100644
--- a/test/Semantics/getdefinition04.f90
+++ b/test/Semantics/getdefinition04.f90
@@ -6,5 +6,5 @@
   x = y
 end program
 
-! RUN: %f18 -fget-definition 6 3 4 -fparse-only %s | FileCheck %s
+! RUN: %f18 -fget-definition 6 3 4 -fsyntax-only %s | FileCheck %s
 ! CHECK: x:{{.*}}getdefinition04.f90, 3, 14-15
diff --git a/test/Semantics/getdefinition05.f90 b/test/Semantics/getdefinition05.f90
index 315e957..91952bb 100644
--- a/test/Semantics/getdefinition05.f90
+++ b/test/Semantics/getdefinition05.f90
@@ -12,8 +12,8 @@
 end program
 
 !! Inner x
-! RUN: %f18 -fget-definition 9 5 6 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 9 5 6 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
 ! CHECK1: x:{{.*}}getdefinition05.f90, 7, 16-17
 !! Outer y
-! RUN: %f18 -fget-definition 11 7 8 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 11 7 8 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
 ! CHECK2: y:{{.*}}getdefinition05.f90, 5, 14-15
diff --git a/test/Semantics/getsymbols01.f90 b/test/Semantics/getsymbols01.f90
index bdb7bf0..d26aa77 100644
--- a/test/Semantics/getsymbols01.f90
+++ b/test/Semantics/getsymbols01.f90
@@ -15,7 +15,7 @@
  end function
 end module
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK-COUNT-1:f:{{.*}}getsymbols01.f90, 12, 26-27
 ! CHECK-COUNT-1:mm1:{{.*}}getsymbols01.f90, 2, 8-11
 ! CHECK-COUNT-1:s:{{.*}}getsymbols01.f90, 5, 18-19
diff --git a/test/Semantics/getsymbols02.f90 b/test/Semantics/getsymbols02.f90
index 0119ab1..1667548 100644
--- a/test/Semantics/getsymbols02.f90
+++ b/test/Semantics/getsymbols02.f90
@@ -7,8 +7,8 @@
     i = callget5()
 ENDPROGRAM
 
-! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-a.f90
-! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-b.f90
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only %S/Inputs/getsymbols02-a.f90
+! RUN: %f18 -fsyntax-only %S/Inputs/getsymbols02-b.f90
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK: callget5: .{{[/\\]}}mm2b.mod,
 ! CHECK: get5: .{{[/\\]}}mm2a.mod,
diff --git a/test/Semantics/getsymbols03-a.f90 b/test/Semantics/getsymbols03-a.f90
index 3cbba42..fddf513 100644
--- a/test/Semantics/getsymbols03-a.f90
+++ b/test/Semantics/getsymbols03-a.f90
@@ -7,7 +7,7 @@
  x = f
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:f:{{.*}}getsymbols03-b.f90, 2, 12-13
 ! CHECK:main:{{.*}}getsymbols03-a.f90, 4, 9-13
 ! CHECK:mm3:{{.*}}getsymbols03-a.f90, 5, 6-9
diff --git a/test/Semantics/getsymbols04.f90 b/test/Semantics/getsymbols04.f90
index fc9b177..ac8f2d0 100644
--- a/test/Semantics/getsymbols04.f90
+++ b/test/Semantics/getsymbols04.f90
@@ -6,7 +6,7 @@
   x = y
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:x:{{.*}}getsymbols04.f90, 3, 14-15
 ! CHECK:x:{{.*}}getsymbols04.f90, 5, 11-12
 ! CHECK:y:{{.*}}getsymbols04.f90, 4, 14-15
diff --git a/test/Semantics/getsymbols05.f90 b/test/Semantics/getsymbols05.f90
index 624f37a..6b07678 100644
--- a/test/Semantics/getsymbols05.f90
+++ b/test/Semantics/getsymbols05.f90
@@ -9,7 +9,7 @@
   x = y
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:x:{{.*}}getsymbols05.f90, 3, 14-15
 ! CHECK:x:{{.*}}getsymbols05.f90, 6, 16-17
 ! CHECK:y:{{.*}}getsymbols05.f90, 4, 14-15
diff --git a/test/Semantics/missing_newline.f90 b/test/Semantics/missing_newline.f90
index 6dfafba..82f9c9c 100644
--- a/test/Semantics/missing_newline.f90
+++ b/test/Semantics/missing_newline.f90
@@ -1,4 +1,4 @@
 ! RUN: echo -n "end program" > %t.f90
-! RUN: %f18 -fparse-only %t.f90
+! RUN: %f18 -fsyntax-only %t.f90
 ! RUN: echo -ne "\rend program" > %t.f90
-! RUN: %f18 -fparse-only %t.f90
+! RUN: %f18 -fsyntax-only %t.f90
diff --git a/test/Semantics/mod-file-rewriter.f90 b/test/Semantics/mod-file-rewriter.f90
index 8125291..2856dd6 100644
--- a/test/Semantics/mod-file-rewriter.f90
+++ b/test/Semantics/mod-file-rewriter.f90
@@ -1,8 +1,8 @@
 ! RUN: rm -fr %t && mkdir %t && cd %t
-! RUN: %f18 -fparse-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %p/Inputs/mod-file-unchanged.f90 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %p/Inputs/mod-file-changed.f90 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %p/Inputs/mod-file-unchanged.f90 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %p/Inputs/mod-file-changed.f90 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
 
 module m
   real :: x(10)
diff --git a/test/Semantics/modifiable01.f90 b/test/Semantics/modifiable01.f90
index 391a643..dfa9396 100644
--- a/test/Semantics/modifiable01.f90
+++ b/test/Semantics/modifiable01.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 ! Test WhyNotModifiable() explanations
 
 module prot
diff --git a/test/Semantics/offsets01.f90 b/test/Semantics/offsets01.f90
index f5491f7..78183d5 100644
--- a/test/Semantics/offsets01.f90
+++ b/test/Semantics/offsets01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment of intrinsic types
 subroutine s1
diff --git a/test/Semantics/offsets02.f90 b/test/Semantics/offsets02.f90
index f2ed1d1..b76572e 100644
--- a/test/Semantics/offsets02.f90
+++ b/test/Semantics/offsets02.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment of derived types
 
diff --git a/test/Semantics/offsets03.f90 b/test/Semantics/offsets03.f90
index d28b369..c1c2de4 100644
--- a/test/Semantics/offsets03.f90
+++ b/test/Semantics/offsets03.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment with EQUIVALENCE and COMMON
 
diff --git a/test/Semantics/oldparam01.f90 b/test/Semantics/oldparam01.f90
index 43f33a5..b78869f 100644
--- a/test/Semantics/oldparam01.f90
+++ b/test/Semantics/oldparam01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -falternative-parameter-statement -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -falternative-parameter-statement -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Non-error tests for "old style" PARAMETER statements
 
diff --git a/test/Semantics/oldparam02.f90 b/test/Semantics/oldparam02.f90
index 72ea5c4..fd58988 100644
--- a/test/Semantics/oldparam02.f90
+++ b/test/Semantics/oldparam02.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -falternative-parameter-statement -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -falternative-parameter-statement -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Error tests for "old style" PARAMETER statements
 subroutine subr(x1,x2,x3,x4,x5)
diff --git a/test/Semantics/oldparam03.f90 b/test/Semantics/oldparam03.f90
index cbdb070..bc80f00 100644
--- a/test/Semantics/oldparam03.f90
+++ b/test/Semantics/oldparam03.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Ensure that old-style PARAMETER statements are disabled by default.
 
diff --git a/test/Semantics/resolve100.f90 b/test/Semantics/resolve100.f90
index 1e84be2..52fca54 100644
--- a/test/Semantics/resolve100.f90
+++ b/test/Semantics/resolve100.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 program p
   ! CHECK: a size=4 offset=0: ObjectEntity type: LOGICAL(4)
diff --git a/test/Semantics/rewrite01.f90 b/test/Semantics/rewrite01.f90
index 2219945..cd5453e 100644
--- a/test/Semantics/rewrite01.f90
+++ b/test/Semantics/rewrite01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
 ! Ensure that READ(CVAR) [, item-list] is corrected when CVAR is a
 ! character variable so as to be a formatted read from the default
 ! unit, not an unformatted read from an internal unit (which is not
diff --git a/test/Semantics/test_errors.sh b/test/Semantics/test_errors.sh
index 5411482..10feccb 100755
--- a/test/Semantics/test_errors.sh
+++ b/test/Semantics/test_errors.sh
@@ -2,7 +2,7 @@
 # Compile a source file and check errors against those listed in the file.
 # Change the compiler by setting the F18 environment variable.
 
-F18_OPTIONS="-fparse-only"
+F18_OPTIONS="-fsyntax-only"
 srcdir=$(dirname $0)
 source $srcdir/common.sh
 [[ ! -f $src ]] && die "File not found: $src"
diff --git a/test/Semantics/test_modfile.sh b/test/Semantics/test_modfile.sh
index 9205451..a2aef65 100755
--- a/test/Semantics/test_modfile.sh
+++ b/test/Semantics/test_modfile.sh
@@ -2,7 +2,7 @@
 # Compile a source file and compare generated .mod files against expected.
 
 set -e
-F18_OPTIONS="-fdebug-resolve-names -fparse-only"
+F18_OPTIONS="-fdebug-resolve-names -fsyntax-only"
 srcdir=$(dirname $0)
 source $srcdir/common.sh
 
diff --git a/test/Semantics/typeinfo01.f90 b/test/Semantics/typeinfo01.f90
index 834120c..2274896 100644
--- a/test/Semantics/typeinfo01.f90
+++ b/test/Semantics/typeinfo01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 ! Tests for derived type runtime descriptions
 
 module m01
diff --git a/tools/f18-parse-demo/f18-parse-demo.cpp b/tools/f18-parse-demo/f18-parse-demo.cpp
index 4ccc65e..2033ef6 100644
--- a/tools/f18-parse-demo/f18-parse-demo.cpp
+++ b/tools/f18-parse-demo/f18-parse-demo.cpp
@@ -87,7 +87,7 @@
   bool warnOnNonstandardUsage{false}; // -Mstandard
   bool warningsAreErrors{false}; // -Werror
   Fortran::parser::Encoding encoding{Fortran::parser::Encoding::LATIN_1};
-  bool parseOnly{false};
+  bool syntaxOnly{false};
   bool dumpProvenance{false};
   bool dumpCookedChars{false};
   bool dumpUnparse{false};
@@ -217,7 +217,7 @@
             Fortran::common::LanguageFeature::BackslashEscapes));
     return {};
   }
-  if (driver.parseOnly) {
+  if (driver.syntaxOnly) {
     return {};
   }
 
@@ -369,8 +369,8 @@
       driver.dumpUnparse = true;
     } else if (arg == "-ftime-parse") {
       driver.timeParse = true;
-    } else if (arg == "-fparse-only") {
-      driver.parseOnly = true;
+    } else if (arg == "-fparse-only" || arg == "-fsyntax-only") {
+      driver.syntaxOnly = true;
     } else if (arg == "-c") {
       driver.compileOnly = true;
     } else if (arg == "-o") {
@@ -405,7 +405,7 @@
           << "  -ed                  enable fixed form D lines\n"
           << "  -E                   prescan & preprocess only\n"
           << "  -ftime-parse         measure parsing time\n"
-          << "  -fparse-only         parse only, no output except messages\n"
+          << "  -fsyntax-only        parse only, no output except messages\n"
           << "  -funparse            parse & reformat only, no code "
              "generation\n"
           << "  -fdump-provenance    dump the provenance table (no code)\n"
diff --git a/tools/f18/CMakeLists.txt b/tools/f18/CMakeLists.txt
index 2e5350a..41237fe 100644
--- a/tools/f18/CMakeLists.txt
+++ b/tools/f18/CMakeLists.txt
@@ -46,7 +46,7 @@
     set(depends ${include}/__fortran_builtins.mod)
   endif()
   add_custom_command(OUTPUT ${include}/${filename}.mod
-    COMMAND f18 -fparse-only -I${include}
+    COMMAND f18 -fsyntax-only -I${include}
       ${FLANG_SOURCE_DIR}/module/${filename}.f90
     WORKING_DIRECTORY ${include}
     DEPENDS f18 ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}
diff --git a/tools/f18/f18.cpp b/tools/f18/f18.cpp
index fecd37d..4546353 100644
--- a/tools/f18/f18.cpp
+++ b/tools/f18/f18.cpp
@@ -92,7 +92,7 @@
   bool warningsAreErrors{false}; // -Werror
   bool byteswapio{false}; // -byteswapio
   Fortran::parser::Encoding encoding{Fortran::parser::Encoding::UTF_8};
-  bool parseOnly{false};
+  bool syntaxOnly{false};
   bool dumpProvenance{false};
   bool dumpCookedChars{false};
   bool dumpUnparse{false};
@@ -327,7 +327,7 @@
       exitStatus = EXIT_FAILURE;
     }
   }
-  if (driver.parseOnly) {
+  if (driver.syntaxOnly) {
     return {};
   }
 
@@ -544,8 +544,8 @@
       driver.dumpUnparseWithSymbols = true;
     } else if (arg == "-funparse-typed-exprs-to-f18-fc") {
       driver.unparseTypedExprsToF18_FC = true;
-    } else if (arg == "-fparse-only") {
-      driver.parseOnly = true;
+    } else if (arg == "-fparse-only" || arg == "-fsyntax-only") {
+      driver.syntaxOnly = true;
     } else if (arg == "-c") {
       driver.compileOnly = true;
     } else if (arg == "-o") {
@@ -649,7 +649,7 @@
           << "  -module dir          module output directory (default .)\n"
           << "  -flatin              interpret source as Latin-1 (ISO 8859-1) "
              "rather than UTF-8\n"
-          << "  -fparse-only         parse only, no output except messages\n"
+          << "  -fsyntax-only        parsing and semantics only, no output except messages\n"
           << "  -funparse            parse & reformat only, no code "
              "generation\n"
           << "  -funparse-with-symbols  parse, resolve symbols, and unparse\n"