[flang-commits] [flang] 99aa87a - [flang][NFC] Simplify semantics test scripts

Tim Keith via flang-commits flang-commits at lists.llvm.org
Mon May 11 11:50:13 PDT 2020


Author: Tim Keith
Date: 2020-05-11T11:49:25-07:00
New Revision: 99aa87a5b5371b3c06480e3ff99dcc4f2adf2c2a

URL: https://github.com/llvm/llvm-project/commit/99aa87a5b5371b3c06480e3ff99dcc4f2adf2c2a
DIFF: https://github.com/llvm/llvm-project/commit/99aa87a5b5371b3c06480e3ff99dcc4f2adf2c2a.diff

LOG: [flang][NFC] Simplify semantics test scripts

There were several different ways of handling the option to f18 to
find predefined modules:
- test_errors.sh was created by cmake substituting
  FLANG_INTRINSIC_MODULES_DIR into test_errors.sh.in
- some tests used the flang script which has the option built it
- some tests used %f18_with_includes which was replaced by the path
  to f18 plus the -I option
- some included -I../../include/flang in their run command

To make this more consistent, change %f18 to include the
-intrinsic-module-directory option and use it everywhere, including
to replace %flang and %f18_with_includes. This requires changing all
of the invocations of the test scripts to put %f18 at the end so that
it can expand to more than one argument.

This eliminates the need to generate test_errors.sh which means we
don't need flang/test/Semantics/CMakeLists.txt or the %B substitution.
That makes the test_errors.sh command like the others, replacing
%B/test/Semantics/test_errors.sh with %S/test_errors.sh.

Also remove the OPTIONS: functionality as custom options can be included
in the RUN: command. And remove -I/../../include/flang as that is now
always included.

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

Added: 
    flang/test/Semantics/test_errors.sh

Modified: 
    flang/test/CMakeLists.txt
    flang/test/Evaluate/folding01.f90
    flang/test/Evaluate/folding02.f90
    flang/test/Evaluate/folding03.f90
    flang/test/Evaluate/folding04.f90
    flang/test/Evaluate/folding05.f90
    flang/test/Evaluate/folding06.f90
    flang/test/Evaluate/folding07.f90
    flang/test/Evaluate/folding08.f90
    flang/test/Evaluate/folding09.f90
    flang/test/Evaluate/test_folding.sh
    flang/test/Lower/pre-fir-tree04.f90
    flang/test/Semantics/allocate01.f90
    flang/test/Semantics/allocate02.f90
    flang/test/Semantics/allocate03.f90
    flang/test/Semantics/allocate04.f90
    flang/test/Semantics/allocate05.f90
    flang/test/Semantics/allocate06.f90
    flang/test/Semantics/allocate07.f90
    flang/test/Semantics/allocate08.f90
    flang/test/Semantics/allocate09.f90
    flang/test/Semantics/allocate10.f90
    flang/test/Semantics/allocate11.f90
    flang/test/Semantics/allocate12.f90
    flang/test/Semantics/allocate13.f90
    flang/test/Semantics/altreturn01.f90
    flang/test/Semantics/altreturn02.f90
    flang/test/Semantics/altreturn03.f90
    flang/test/Semantics/altreturn04.f90
    flang/test/Semantics/altreturn05.f90
    flang/test/Semantics/assign01.f90
    flang/test/Semantics/assign02.f90
    flang/test/Semantics/assign03.f90
    flang/test/Semantics/assign04.f90
    flang/test/Semantics/assign06.f90
    flang/test/Semantics/assign07.f90
    flang/test/Semantics/bad-forward-type.f90
    flang/test/Semantics/bindings01.f90
    flang/test/Semantics/block-data01.f90
    flang/test/Semantics/blockconstruct01.f90
    flang/test/Semantics/blockconstruct02.f90
    flang/test/Semantics/blockconstruct03.f90
    flang/test/Semantics/c_f_pointer.f90
    flang/test/Semantics/call01.f90
    flang/test/Semantics/call02.f90
    flang/test/Semantics/call03.f90
    flang/test/Semantics/call04.f90
    flang/test/Semantics/call05.f90
    flang/test/Semantics/call06.f90
    flang/test/Semantics/call07.f90
    flang/test/Semantics/call08.f90
    flang/test/Semantics/call09.f90
    flang/test/Semantics/call10.f90
    flang/test/Semantics/call11.f90
    flang/test/Semantics/call12.f90
    flang/test/Semantics/call13.f90
    flang/test/Semantics/call14.f90
    flang/test/Semantics/call15.f90
    flang/test/Semantics/canondo01.f90
    flang/test/Semantics/canondo02.f90
    flang/test/Semantics/canondo03.f90
    flang/test/Semantics/canondo04.f90
    flang/test/Semantics/canondo05.f90
    flang/test/Semantics/canondo06.f90
    flang/test/Semantics/canondo07.f90
    flang/test/Semantics/canondo08.f90
    flang/test/Semantics/canondo09.f90
    flang/test/Semantics/canondo10.f90
    flang/test/Semantics/canondo11.f90
    flang/test/Semantics/canondo12.f90
    flang/test/Semantics/canondo13.f90
    flang/test/Semantics/canondo14.f90
    flang/test/Semantics/canondo15.f90
    flang/test/Semantics/canondo16.f90
    flang/test/Semantics/canondo17.f90
    flang/test/Semantics/canondo18.f90
    flang/test/Semantics/canondo19.f90
    flang/test/Semantics/case01.f90
    flang/test/Semantics/coarrays01.f90
    flang/test/Semantics/common.sh
    flang/test/Semantics/complex01.f90
    flang/test/Semantics/computed-goto01.f90
    flang/test/Semantics/computed-goto02.f90
    flang/test/Semantics/critical01.f90
    flang/test/Semantics/critical02.f90
    flang/test/Semantics/critical03.f90
    flang/test/Semantics/critical04.f90
    flang/test/Semantics/data01.f90
    flang/test/Semantics/data02.f90
    flang/test/Semantics/data03.f90
    flang/test/Semantics/deallocate01.f90
    flang/test/Semantics/deallocate04.f90
    flang/test/Semantics/deallocate05.f90
    flang/test/Semantics/doconcurrent01.f90
    flang/test/Semantics/doconcurrent02.f90
    flang/test/Semantics/doconcurrent03.f90
    flang/test/Semantics/doconcurrent04.f90
    flang/test/Semantics/doconcurrent05.f90
    flang/test/Semantics/doconcurrent06.f90
    flang/test/Semantics/doconcurrent07.f90
    flang/test/Semantics/doconcurrent08.f90
    flang/test/Semantics/dosemantics01.f90
    flang/test/Semantics/dosemantics02.f90
    flang/test/Semantics/dosemantics03.f90
    flang/test/Semantics/dosemantics04.f90
    flang/test/Semantics/dosemantics05.f90
    flang/test/Semantics/dosemantics06.f90
    flang/test/Semantics/dosemantics07.f90
    flang/test/Semantics/dosemantics08.f90
    flang/test/Semantics/dosemantics09.f90
    flang/test/Semantics/dosemantics10.f90
    flang/test/Semantics/dosemantics11.f90
    flang/test/Semantics/dosemantics12.f90
    flang/test/Semantics/entry01.f90
    flang/test/Semantics/equivalence01.f90
    flang/test/Semantics/expr-errors01.f90
    flang/test/Semantics/expr-errors02.f90
    flang/test/Semantics/forall01.f90
    flang/test/Semantics/getdefinition01.f90
    flang/test/Semantics/getdefinition02.f
    flang/test/Semantics/getdefinition03-a.f90
    flang/test/Semantics/getdefinition04.f90
    flang/test/Semantics/getdefinition05.f90
    flang/test/Semantics/getsymbols01.f90
    flang/test/Semantics/getsymbols02.f90
    flang/test/Semantics/getsymbols03-a.f90
    flang/test/Semantics/getsymbols04.f90
    flang/test/Semantics/getsymbols05.f90
    flang/test/Semantics/if_arith01.f90
    flang/test/Semantics/if_arith02.f90
    flang/test/Semantics/if_arith03.f90
    flang/test/Semantics/if_arith04.f90
    flang/test/Semantics/if_construct01.f90
    flang/test/Semantics/if_construct02.f90
    flang/test/Semantics/if_stmt01.f90
    flang/test/Semantics/if_stmt02.f90
    flang/test/Semantics/if_stmt03.f90
    flang/test/Semantics/implicit01.f90
    flang/test/Semantics/implicit02.f90
    flang/test/Semantics/implicit03.f90
    flang/test/Semantics/implicit04.f90
    flang/test/Semantics/implicit05.f90
    flang/test/Semantics/implicit06.f90
    flang/test/Semantics/implicit07.f90
    flang/test/Semantics/implicit08.f90
    flang/test/Semantics/init01.f90
    flang/test/Semantics/int-literals.f90
    flang/test/Semantics/io01.f90
    flang/test/Semantics/io02.f90
    flang/test/Semantics/io03.f90
    flang/test/Semantics/io04.f90
    flang/test/Semantics/io05.f90
    flang/test/Semantics/io06.f90
    flang/test/Semantics/io07.f90
    flang/test/Semantics/io08.f90
    flang/test/Semantics/io09.f90
    flang/test/Semantics/io10.f90
    flang/test/Semantics/kinds01.f90
    flang/test/Semantics/kinds02.f90
    flang/test/Semantics/kinds03.f90
    flang/test/Semantics/kinds04.f90
    flang/test/Semantics/label01.F90
    flang/test/Semantics/label02.f90
    flang/test/Semantics/label03.f90
    flang/test/Semantics/label04.f90
    flang/test/Semantics/label05.f90
    flang/test/Semantics/label06.f90
    flang/test/Semantics/label07.f90
    flang/test/Semantics/label08.f90
    flang/test/Semantics/label09.f90
    flang/test/Semantics/label10.f90
    flang/test/Semantics/label11.f90
    flang/test/Semantics/label12.f90
    flang/test/Semantics/label13.f90
    flang/test/Semantics/label14.f90
    flang/test/Semantics/misc-declarations.f90
    flang/test/Semantics/modfile01.f90
    flang/test/Semantics/modfile02.f90
    flang/test/Semantics/modfile03.f90
    flang/test/Semantics/modfile04.f90
    flang/test/Semantics/modfile05.f90
    flang/test/Semantics/modfile06.f90
    flang/test/Semantics/modfile07.f90
    flang/test/Semantics/modfile08.f90
    flang/test/Semantics/modfile09.f90
    flang/test/Semantics/modfile10.f90
    flang/test/Semantics/modfile11.f90
    flang/test/Semantics/modfile12.f90
    flang/test/Semantics/modfile13.f90
    flang/test/Semantics/modfile14.f90
    flang/test/Semantics/modfile15.f90
    flang/test/Semantics/modfile16.f90
    flang/test/Semantics/modfile17.f90
    flang/test/Semantics/modfile18.f90
    flang/test/Semantics/modfile19.f90
    flang/test/Semantics/modfile20.f90
    flang/test/Semantics/modfile21.f90
    flang/test/Semantics/modfile22.f90
    flang/test/Semantics/modfile23.f90
    flang/test/Semantics/modfile24.f90
    flang/test/Semantics/modfile25.f90
    flang/test/Semantics/modfile26.f90
    flang/test/Semantics/modfile27.f90
    flang/test/Semantics/modfile28.f90
    flang/test/Semantics/modfile29.f90
    flang/test/Semantics/modfile30.f90
    flang/test/Semantics/modfile31.f90
    flang/test/Semantics/modfile32.f90
    flang/test/Semantics/modfile33.f90
    flang/test/Semantics/modfile34.f90
    flang/test/Semantics/modfile35.f90
    flang/test/Semantics/namelist01.f90
    flang/test/Semantics/null01.f90
    flang/test/Semantics/nullify01.f90
    flang/test/Semantics/nullify02.f90
    flang/test/Semantics/omp-atomic.f90
    flang/test/Semantics/omp-clause-validity01.f90
    flang/test/Semantics/omp-combined-constructs.f90
    flang/test/Semantics/omp-declarative-directive.f90
    flang/test/Semantics/omp-device-constructs.f90
    flang/test/Semantics/omp-loop-association.f90
    flang/test/Semantics/omp-nested01.f90
    flang/test/Semantics/omp-resolve01.f90
    flang/test/Semantics/omp-resolve02.f90
    flang/test/Semantics/omp-resolve03.f90
    flang/test/Semantics/omp-resolve04.f90
    flang/test/Semantics/omp-resolve05.f90
    flang/test/Semantics/omp-symbol01.f90
    flang/test/Semantics/omp-symbol02.f90
    flang/test/Semantics/omp-symbol03.f90
    flang/test/Semantics/omp-symbol04.f90
    flang/test/Semantics/omp-symbol05.f90
    flang/test/Semantics/omp-symbol06.f90
    flang/test/Semantics/omp-symbol07.f90
    flang/test/Semantics/omp-symbol08.f90
    flang/test/Semantics/procinterface01.f90
    flang/test/Semantics/resolve01.f90
    flang/test/Semantics/resolve02.f90
    flang/test/Semantics/resolve03.f90
    flang/test/Semantics/resolve04.f90
    flang/test/Semantics/resolve05.f90
    flang/test/Semantics/resolve06.f90
    flang/test/Semantics/resolve07.f90
    flang/test/Semantics/resolve08.f90
    flang/test/Semantics/resolve09.f90
    flang/test/Semantics/resolve10.f90
    flang/test/Semantics/resolve11.f90
    flang/test/Semantics/resolve12.f90
    flang/test/Semantics/resolve13.f90
    flang/test/Semantics/resolve14.f90
    flang/test/Semantics/resolve15.f90
    flang/test/Semantics/resolve16.f90
    flang/test/Semantics/resolve17.f90
    flang/test/Semantics/resolve18.f90
    flang/test/Semantics/resolve19.f90
    flang/test/Semantics/resolve20.f90
    flang/test/Semantics/resolve21.f90
    flang/test/Semantics/resolve22.f90
    flang/test/Semantics/resolve23.f90
    flang/test/Semantics/resolve24.f90
    flang/test/Semantics/resolve25.f90
    flang/test/Semantics/resolve26.f90
    flang/test/Semantics/resolve27.f90
    flang/test/Semantics/resolve28.f90
    flang/test/Semantics/resolve29.f90
    flang/test/Semantics/resolve30.f90
    flang/test/Semantics/resolve31.f90
    flang/test/Semantics/resolve32.f90
    flang/test/Semantics/resolve33.f90
    flang/test/Semantics/resolve34.f90
    flang/test/Semantics/resolve35.f90
    flang/test/Semantics/resolve36.f90
    flang/test/Semantics/resolve37.f90
    flang/test/Semantics/resolve38.f90
    flang/test/Semantics/resolve39.f90
    flang/test/Semantics/resolve40.f90
    flang/test/Semantics/resolve41.f90
    flang/test/Semantics/resolve42.f90
    flang/test/Semantics/resolve43.f90
    flang/test/Semantics/resolve44.f90
    flang/test/Semantics/resolve45.f90
    flang/test/Semantics/resolve46.f90
    flang/test/Semantics/resolve47.f90
    flang/test/Semantics/resolve48.f90
    flang/test/Semantics/resolve49.f90
    flang/test/Semantics/resolve50.f90
    flang/test/Semantics/resolve51.f90
    flang/test/Semantics/resolve52.f90
    flang/test/Semantics/resolve53.f90
    flang/test/Semantics/resolve54.f90
    flang/test/Semantics/resolve55.f90
    flang/test/Semantics/resolve56.f90
    flang/test/Semantics/resolve57.f90
    flang/test/Semantics/resolve58.f90
    flang/test/Semantics/resolve59.f90
    flang/test/Semantics/resolve60.f90
    flang/test/Semantics/resolve61.f90
    flang/test/Semantics/resolve62.f90
    flang/test/Semantics/resolve63.f90
    flang/test/Semantics/resolve64.f90
    flang/test/Semantics/resolve65.f90
    flang/test/Semantics/resolve66.f90
    flang/test/Semantics/resolve67.f90
    flang/test/Semantics/resolve68.f90
    flang/test/Semantics/resolve69.f90
    flang/test/Semantics/resolve70.f90
    flang/test/Semantics/resolve71.f90
    flang/test/Semantics/resolve72.f90
    flang/test/Semantics/resolve73.f90
    flang/test/Semantics/resolve74.f90
    flang/test/Semantics/resolve75.f90
    flang/test/Semantics/resolve76.f90
    flang/test/Semantics/resolve77.f90
    flang/test/Semantics/resolve78.f90
    flang/test/Semantics/resolve79.f90
    flang/test/Semantics/resolve80.f90
    flang/test/Semantics/resolve81.f90
    flang/test/Semantics/resolve82.f90
    flang/test/Semantics/resolve83.f90
    flang/test/Semantics/resolve84.f90
    flang/test/Semantics/resolve85.f90
    flang/test/Semantics/resolve86.f90
    flang/test/Semantics/resolve87.f90
    flang/test/Semantics/resolve88.f90
    flang/test/Semantics/resolve89.f90
    flang/test/Semantics/select-rank.f90
    flang/test/Semantics/select-rank02.f90
    flang/test/Semantics/separate-mp01.f90
    flang/test/Semantics/separate-mp02.f90
    flang/test/Semantics/stop01.f90
    flang/test/Semantics/structconst01.f90
    flang/test/Semantics/structconst02.f90
    flang/test/Semantics/structconst03.f90
    flang/test/Semantics/structconst04.f90
    flang/test/Semantics/symbol01.f90
    flang/test/Semantics/symbol02.f90
    flang/test/Semantics/symbol03.f90
    flang/test/Semantics/symbol05.f90
    flang/test/Semantics/symbol06.f90
    flang/test/Semantics/symbol07.f90
    flang/test/Semantics/symbol08.f90
    flang/test/Semantics/symbol09.f90
    flang/test/Semantics/symbol10.f90
    flang/test/Semantics/symbol11.f90
    flang/test/Semantics/symbol12.f90
    flang/test/Semantics/symbol13.f90
    flang/test/Semantics/symbol14.f90
    flang/test/Semantics/symbol15.f90
    flang/test/Semantics/symbol16.f90
    flang/test/Semantics/symbol17.f90
    flang/test/Semantics/test_any.sh
    flang/test/Semantics/test_modfile.sh
    flang/test/Semantics/test_symbols.sh
    flang/test/lit.cfg.py

Removed: 
    flang/test/Semantics/CMakeLists.txt
    flang/test/Semantics/test_errors.sh.in


################################################################################
diff  --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt
index 993d0d4994b7..c98811e807bb 100644
--- a/flang/test/CMakeLists.txt
+++ b/flang/test/CMakeLists.txt
@@ -12,8 +12,6 @@ configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
 )
 
-add_subdirectory(Semantics)
-
 set(FLANG_TEST_PARAMS
   flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
 
@@ -31,7 +29,7 @@ add_lit_testsuite(check-flang "Running the Flang regression tests"
   ${CMAKE_CURRENT_BINARY_DIR}
   PARAMS ${FLANG_TEST_PARAMS}
   DEPENDS ${FLANG_TEST_DEPENDS}
-  )
+)
 set_target_properties(check-flang PROPERTIES FOLDER "Tests")
 
 add_lit_testsuites(FLANG ${CMAKE_CURRENT_SOURCE_DIR}

diff  --git a/flang/test/Evaluate/folding01.f90 b/flang/test/Evaluate/folding01.f90
index 8a75a819ff81..09004649e9d5 100644
--- a/flang/test/Evaluate/folding01.f90
+++ b/flang/test/Evaluate/folding01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 
 ! Test intrinsic operation folding
 

diff  --git a/flang/test/Evaluate/folding02.f90 b/flang/test/Evaluate/folding02.f90
index b69ff87b5c20..977bd824d8c6 100644
--- a/flang/test/Evaluate/folding02.f90
+++ b/flang/test/Evaluate/folding02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Check intrinsic function folding with host runtime library
 
 module m

diff  --git a/flang/test/Evaluate/folding03.f90 b/flang/test/Evaluate/folding03.f90
index c5e26faf8327..c50390036deb 100644
--- a/flang/test/Evaluate/folding03.f90
+++ b/flang/test/Evaluate/folding03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test operation folding edge case (both expected value and messages)
 ! These tests make assumptions regarding real(4) and integer(4) extrema.
 

diff  --git a/flang/test/Evaluate/folding04.f90 b/flang/test/Evaluate/folding04.f90
index a0e207b375b7..a9f48851edbb 100644
--- a/flang/test/Evaluate/folding04.f90
+++ b/flang/test/Evaluate/folding04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test intrinsic function folding edge case (both expected value and messages)
 ! These tests make assumptions regarding real(4) extrema.
 

diff  --git a/flang/test/Evaluate/folding05.f90 b/flang/test/Evaluate/folding05.f90
index 79635e392d77..aeccee04b5cb 100644
Binary files a/flang/test/Evaluate/folding05.f90 and b/flang/test/Evaluate/folding05.f90 
diff er

diff  --git a/flang/test/Evaluate/folding06.f90 b/flang/test/Evaluate/folding06.f90
index 42dc70d5165e..3cfe3098ba1d 100644
--- a/flang/test/Evaluate/folding06.f90
+++ b/flang/test/Evaluate/folding06.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test transformational intrinsic function folding
 
 module m

diff  --git a/flang/test/Evaluate/folding07.f90 b/flang/test/Evaluate/folding07.f90
index 9c9c0a40ed61..b99d98993d3e 100644
--- a/flang/test/Evaluate/folding07.f90
+++ b/flang/test/Evaluate/folding07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test numeric model inquiry intrinsics
 
 module m

diff  --git a/flang/test/Evaluate/folding08.f90 b/flang/test/Evaluate/folding08.f90
index 67f435a99f31..2a4d58ec4f2d 100644
--- a/flang/test/Evaluate/folding08.f90
+++ b/flang/test/Evaluate/folding08.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test folding of LBOUND and UBOUND
 
 module m

diff  --git a/flang/test/Evaluate/folding09.f90 b/flang/test/Evaluate/folding09.f90
index a7510604acca..6efd3c0b6669 100644
--- a/flang/test/Evaluate/folding09.f90
+++ b/flang/test/Evaluate/folding09.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
 ! Test folding of IS_CONTIGUOUS on simply contiguous items (9.5.4)
 ! When IS_CONTIGUOUS() is constant, it's .TRUE.
 

diff  --git a/flang/test/Evaluate/test_folding.sh b/flang/test/Evaluate/test_folding.sh
index 3834c21edad7..20f7d1672246 100755
--- a/flang/test/Evaluate/test_folding.sh
+++ b/flang/test/Evaluate/test_folding.sh
@@ -19,18 +19,20 @@
 #   - test_x is not folded (it is neither .true. nor .false.). This means the
 #     compiler could not fold the expression.
 
-CMD="$2 -fdebug-dump-symbols -fparse-only"
-
 if [[ $# < 3 ]]; then
-  echo "Usage: $0 <fortran-source> <f18-executable> <temp test dir>"
+  echo "Usage: $0 <fortran-source> <temp test dir> <f18-executable>"
   exit 1
 fi
 
 src=$1
 [[ ! -f $src ]] && echo "File not found: $src" && exit 1
+shift
 
-temp=$3
+temp=$1
 mkdir -p $temp
+shift
+
+CMD="$* -fdebug-dump-symbols -fparse-only"
 
 # Check if tests should assume folding is using libpgmath
 if [[ $LIBPGMATH ]]; then

diff  --git a/flang/test/Lower/pre-fir-tree04.f90 b/flang/test/Lower/pre-fir-tree04.f90
index 3e8516e57bbb..8e39d7255750 100644
--- a/flang/test/Lower/pre-fir-tree04.f90
+++ b/flang/test/Lower/pre-fir-tree04.f90
@@ -1,4 +1,4 @@
-! RUN: %f18_with_includes -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures all the coarray related statements
 

diff  --git a/flang/test/Semantics/CMakeLists.txt b/flang/test/Semantics/CMakeLists.txt
deleted file mode 100644
index bdc81bbbe18c..000000000000
--- a/flang/test/Semantics/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-configure_file(test_errors.sh.in ${FLANG_BINARY_DIR}/test/Semantics/test_errors.sh @ONLY)

diff  --git a/flang/test/Semantics/allocate01.f90 b/flang/test/Semantics/allocate01.f90
index 4907a9d9e21f..81d77e5cc9b4 100644
--- a/flang/test/Semantics/allocate01.f90
+++ b/flang/test/Semantics/allocate01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 ! Creating a symbol that allocate should accept

diff  --git a/flang/test/Semantics/allocate02.f90 b/flang/test/Semantics/allocate02.f90
index 16895ef35001..b16391b5d3c6 100644
--- a/flang/test/Semantics/allocate02.f90
+++ b/flang/test/Semantics/allocate02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 ! Check for semantic errors in ALLOCATE statements
 

diff  --git a/flang/test/Semantics/allocate03.f90 b/flang/test/Semantics/allocate03.f90
index 21b093ddefe9..fa0febccfc5a 100644
--- a/flang/test/Semantics/allocate03.f90
+++ b/flang/test/Semantics/allocate03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C933_a(b1, ca3, ca4, cp3, cp3mold, cp4, cp7, cp8, bsrc)

diff  --git a/flang/test/Semantics/allocate04.f90 b/flang/test/Semantics/allocate04.f90
index 9371fcb2b1af..b74b18765089 100644
--- a/flang/test/Semantics/allocate04.f90
+++ b/flang/test/Semantics/allocate04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate05.f90 b/flang/test/Semantics/allocate05.f90
index e69ed9e5399f..da7fdcabc82a 100644
--- a/flang/test/Semantics/allocate05.f90
+++ b/flang/test/Semantics/allocate05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate06.f90 b/flang/test/Semantics/allocate06.f90
index ae9f4f60d318..0b204f97daa2 100644
--- a/flang/test/Semantics/allocate06.f90
+++ b/flang/test/Semantics/allocate06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate07.f90 b/flang/test/Semantics/allocate07.f90
index 5f261f332381..0a0c5f278a51 100644
--- a/flang/test/Semantics/allocate07.f90
+++ b/flang/test/Semantics/allocate07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C936(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred)

diff  --git a/flang/test/Semantics/allocate08.f90 b/flang/test/Semantics/allocate08.f90
index 7733b3a0767a..c6dce0de5131 100644
--- a/flang/test/Semantics/allocate08.f90
+++ b/flang/test/Semantics/allocate08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C945_a(srca, srcb, srcc, src_complex, src_logical, &

diff  --git a/flang/test/Semantics/allocate09.f90 b/flang/test/Semantics/allocate09.f90
index 6e20521fedd7..3a0feab29689 100644
--- a/flang/test/Semantics/allocate09.f90
+++ b/flang/test/Semantics/allocate09.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C946(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred)

diff  --git a/flang/test/Semantics/allocate10.f90 b/flang/test/Semantics/allocate10.f90
index 2746f8e1e6dc..142e9d0eee6f 100644
--- a/flang/test/Semantics/allocate10.f90
+++ b/flang/test/Semantics/allocate10.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 !TODO: mixing expr and source-expr?

diff  --git a/flang/test/Semantics/allocate11.f90 b/flang/test/Semantics/allocate11.f90
index 01b9944019ae..ca5ed954a999 100644
--- a/flang/test/Semantics/allocate11.f90
+++ b/flang/test/Semantics/allocate11.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 ! TODO: Function Pointer in allocate and derived types!

diff  --git a/flang/test/Semantics/allocate12.f90 b/flang/test/Semantics/allocate12.f90
index 52fabf888f78..95a88a8cb254 100644
--- a/flang/test/Semantics/allocate12.f90
+++ b/flang/test/Semantics/allocate12.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C941_C942b_C950(xsrc, x1, a2, b2, cx1, ca2, cb1, cb2, c1)

diff  --git a/flang/test/Semantics/allocate13.f90 b/flang/test/Semantics/allocate13.f90
index 99812f9d3df6..e5567bd901e8 100644
--- a/flang/test/Semantics/allocate13.f90
+++ b/flang/test/Semantics/allocate13.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in ALLOCATE statements
 
 module not_iso_fortran_env

diff  --git a/flang/test/Semantics/altreturn01.f90 b/flang/test/Semantics/altreturn01.f90
index b35d0799d154..b6a6e4e4be32 100644
--- a/flang/test/Semantics/altreturn01.f90
+++ b/flang/test/Semantics/altreturn01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check calls with alt returns
 
        CALL TEST (N, *100, *200 )

diff  --git a/flang/test/Semantics/altreturn02.f90 b/flang/test/Semantics/altreturn02.f90
index a09df81f6ada..45fc049d1e2a 100644
--- a/flang/test/Semantics/altreturn02.f90
+++ b/flang/test/Semantics/altreturn02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check subroutine with alt return
 
        SUBROUTINE TEST (N, *, *)

diff  --git a/flang/test/Semantics/altreturn03.f90 b/flang/test/Semantics/altreturn03.f90
index 15c5ce650b96..cd46c4cd1116 100644
--- a/flang/test/Semantics/altreturn03.f90
+++ b/flang/test/Semantics/altreturn03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for various alt return error conditions
 
        SUBROUTINE TEST (N, *, *)

diff  --git a/flang/test/Semantics/altreturn04.f90 b/flang/test/Semantics/altreturn04.f90
index 4a9cf5b13ee3..6356c46855b2 100644
--- a/flang/test/Semantics/altreturn04.f90
+++ b/flang/test/Semantics/altreturn04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Functions cannot use alt return
 
 REAL FUNCTION altreturn01(X)

diff  --git a/flang/test/Semantics/altreturn05.f90 b/flang/test/Semantics/altreturn05.f90
index baa8bcfa11ea..28530d9430f9 100644
--- a/flang/test/Semantics/altreturn05.f90
+++ b/flang/test/Semantics/altreturn05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test extension: RETURN from main program
 
 return !ok

diff  --git a/flang/test/Semantics/assign01.f90 b/flang/test/Semantics/assign01.f90
index e8ec06785843..7d02e10de96b 100644
--- a/flang/test/Semantics/assign01.f90
+++ b/flang/test/Semantics/assign01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! 10.2.3.1(2) All masks and LHS of assignments in a WHERE must conform
 
 subroutine s1

diff  --git a/flang/test/Semantics/assign02.f90 b/flang/test/Semantics/assign02.f90
index 91bb845b3343..caf5b6ed9f1f 100644
--- a/flang/test/Semantics/assign02.f90
+++ b/flang/test/Semantics/assign02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Pointer assignment constraints 10.2.2.2
 
 module m1

diff  --git a/flang/test/Semantics/assign03.f90 b/flang/test/Semantics/assign03.f90
index 62749641ea29..1435342b1ead 100644
--- a/flang/test/Semantics/assign03.f90
+++ b/flang/test/Semantics/assign03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Pointer assignment constraints 10.2.2.2 (see also assign02.f90)
 
 module m

diff  --git a/flang/test/Semantics/assign04.f90 b/flang/test/Semantics/assign04.f90
index 4b7724e3f2ad..03e8f6cef7dc 100644
--- a/flang/test/Semantics/assign04.f90
+++ b/flang/test/Semantics/assign04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! 9.4.5
 subroutine s1
   type :: t(k, l)

diff  --git a/flang/test/Semantics/assign06.f90 b/flang/test/Semantics/assign06.f90
index 33b7f703b08d..a2e7a59b7fd6 100644
--- a/flang/test/Semantics/assign06.f90
+++ b/flang/test/Semantics/assign06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test ASSIGN statement, assigned GOTO, and assigned format labels
 ! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)
 

diff  --git a/flang/test/Semantics/assign07.f90 b/flang/test/Semantics/assign07.f90
index 9d62da5df1b1..8ea1024e9885 100644
--- a/flang/test/Semantics/assign07.f90
+++ b/flang/test/Semantics/assign07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test ASSIGN statement, assigned GOTO, and assigned format labels
 ! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)
 

diff  --git a/flang/test/Semantics/bad-forward-type.f90 b/flang/test/Semantics/bad-forward-type.f90
index 0fda08f3718c..5fe17ad833ad 100644
--- a/flang/test/Semantics/bad-forward-type.f90
+++ b/flang/test/Semantics/bad-forward-type.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Forward references to derived types (error cases)
 ! C732 A parent-type-name shall be the name of a previously defined
 ! extensible type (7.5.7).

diff  --git a/flang/test/Semantics/bindings01.f90 b/flang/test/Semantics/bindings01.f90
index 9d155158ae05..26dd25a24650 100644
--- a/flang/test/Semantics/bindings01.f90
+++ b/flang/test/Semantics/bindings01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Confirm enforcement of constraints and restrictions in 7.5.7.3
 ! and C733, C734 and C779, C780, C781, C782, C783, C784, and C785.
 

diff  --git a/flang/test/Semantics/block-data01.f90 b/flang/test/Semantics/block-data01.f90
index d9c6dcd0843a..ba1bf5df233e 100644
--- a/flang/test/Semantics/block-data01.f90
+++ b/flang/test/Semantics/block-data01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test BLOCK DATA subprogram (14.3)
 block data foo
   !ERROR: IMPORT is not allowed in a BLOCK DATA subprogram

diff  --git a/flang/test/Semantics/blockconstruct01.f90 b/flang/test/Semantics/blockconstruct01.f90
index 86c4ff1a77bd..2b159f42c31c 100644
--- a/flang/test/Semantics/blockconstruct01.f90
+++ b/flang/test/Semantics/blockconstruct01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1107 -- COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, VALUE or
 !          STATEMENT FUNCTIONS not allow in specification part
 

diff  --git a/flang/test/Semantics/blockconstruct02.f90 b/flang/test/Semantics/blockconstruct02.f90
index 77ce3c1a8f57..cc7aeee217f1 100644
--- a/flang/test/Semantics/blockconstruct02.f90
+++ b/flang/test/Semantics/blockconstruct02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1108  --  Save statement in a BLOCK construct shall not conatin a
 !            saved-entity-list that does not specify a common-block-name
 

diff  --git a/flang/test/Semantics/blockconstruct03.f90 b/flang/test/Semantics/blockconstruct03.f90
index 3f1974d19408..a920d9164ed3 100644
--- a/flang/test/Semantics/blockconstruct03.f90
+++ b/flang/test/Semantics/blockconstruct03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests implemented for this standard:
 !            Block Construct
 ! C1109

diff  --git a/flang/test/Semantics/c_f_pointer.f90 b/flang/test/Semantics/c_f_pointer.f90
index ab1b479cfa7d..1243c5b7da84 100644
--- a/flang/test/Semantics/c_f_pointer.f90
+++ b/flang/test/Semantics/c_f_pointer.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Enforce 18.2.3.3
 
 program test

diff  --git a/flang/test/Semantics/call01.f90 b/flang/test/Semantics/call01.f90
index ed77fb81026f..f7289b0510f8 100644
--- a/flang/test/Semantics/call01.f90
+++ b/flang/test/Semantics/call01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Confirm enforcement of constraints and restrictions in 15.6.2.1
 
 non_recursive function f01(n) result(res)

diff  --git a/flang/test/Semantics/call02.f90 b/flang/test/Semantics/call02.f90
index e100a8fcc483..6475f98d9b66 100644
--- a/flang/test/Semantics/call02.f90
+++ b/flang/test/Semantics/call02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! 15.5.1 procedure reference constraints and restrictions
 
 subroutine s01(elem, subr)

diff  --git a/flang/test/Semantics/call03.f90 b/flang/test/Semantics/call03.f90
index 13aba93a2f00..b22032581254 100644
--- a/flang/test/Semantics/call03.f90
+++ b/flang/test/Semantics/call03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.4 constraints and restrictions for non-POINTER non-ALLOCATABLE
 ! dummy arguments.
 

diff  --git a/flang/test/Semantics/call04.f90 b/flang/test/Semantics/call04.f90
index 120cd5435a73..f437f807b301 100644
--- a/flang/test/Semantics/call04.f90
+++ b/flang/test/Semantics/call04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations
 
 module m

diff  --git a/flang/test/Semantics/call05.f90 b/flang/test/Semantics/call05.f90
index a7cd6d9f9b78..c317d3011607 100644
--- a/flang/test/Semantics/call05.f90
+++ b/flang/test/Semantics/call05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.5 constraints and restrictions for POINTER & ALLOCATABLE
 ! arguments when both sides of the call have the same attributes.
 

diff  --git a/flang/test/Semantics/call06.f90 b/flang/test/Semantics/call06.f90
index 77eb0c406e5e..1d37295d1c11 100644
--- a/flang/test/Semantics/call06.f90
+++ b/flang/test/Semantics/call06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.6 constraints and restrictions for ALLOCATABLE
 ! dummy arguments.
 

diff  --git a/flang/test/Semantics/call07.f90 b/flang/test/Semantics/call07.f90
index af9be0235435..db531edb6c64 100644
--- a/flang/test/Semantics/call07.f90
+++ b/flang/test/Semantics/call07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.7 constraints and restrictions for POINTER dummy arguments.
 
 module m

diff  --git a/flang/test/Semantics/call08.f90 b/flang/test/Semantics/call08.f90
index ae4497f316f7..d2d2ca82c5df 100644
--- a/flang/test/Semantics/call08.f90
+++ b/flang/test/Semantics/call08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.8 coarray dummy arguments
 
 module m

diff  --git a/flang/test/Semantics/call09.f90 b/flang/test/Semantics/call09.f90
index 337932d3fe0d..282ae2ec33e4 100644
--- a/flang/test/Semantics/call09.f90
+++ b/flang/test/Semantics/call09.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.5.2.9(2,3,5) dummy procedure requirements
 
 module m

diff  --git a/flang/test/Semantics/call10.f90 b/flang/test/Semantics/call10.f90
index 74a0474175f6..5966b89cdebe 100644
--- a/flang/test/Semantics/call10.f90
+++ b/flang/test/Semantics/call10.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.7 (C1583-C1590, C1592-C1599) constraints and restrictions
 ! for pure procedures.
 ! (C1591 is tested in call11.f90; C1594 in call12.f90.)

diff  --git a/flang/test/Semantics/call11.f90 b/flang/test/Semantics/call11.f90
index d7b590427794..47e3df0164be 100644
--- a/flang/test/Semantics/call11.f90
+++ b/flang/test/Semantics/call11.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.7 C1591 & others: contexts requiring pure subprograms
 
 module m

diff  --git a/flang/test/Semantics/call12.f90 b/flang/test/Semantics/call12.f90
index 65da46b067d6..09ae03b01888 100644
--- a/flang/test/Semantics/call12.f90
+++ b/flang/test/Semantics/call12.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.7 C1594 - prohibited assignments in pure subprograms
 
 module used

diff  --git a/flang/test/Semantics/call13.f90 b/flang/test/Semantics/call13.f90
index 23ef745f8e1c..da8ae6c56077 100644
--- a/flang/test/Semantics/call13.f90
+++ b/flang/test/Semantics/call13.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 15.4.2.2 constraints and restrictions for calls to implicit
 ! interfaces
 

diff  --git a/flang/test/Semantics/call14.f90 b/flang/test/Semantics/call14.f90
index ee5086511de3..5007a0a2d5ee 100644
--- a/flang/test/Semantics/call14.f90
+++ b/flang/test/Semantics/call14.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test 8.5.18 constraints on the VALUE attribute
 
 module m

diff  --git a/flang/test/Semantics/call15.f90 b/flang/test/Semantics/call15.f90
index 1f6646755205..458b3741765a 100644
--- a/flang/test/Semantics/call15.f90
+++ b/flang/test/Semantics/call15.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C711 An assumed-type actual argument that corresponds to an assumed-rank 
 ! dummy argument shall be assumed-shape or assumed-rank.
 subroutine s(arg1, arg2, arg3)

diff  --git a/flang/test/Semantics/canondo01.f90 b/flang/test/Semantics/canondo01.f90
index 51060f8a5f1d..a717450b953e 100644
--- a/flang/test/Semantics/canondo01.f90
+++ b/flang/test/Semantics/canondo01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/canondo02.f90 b/flang/test/Semantics/canondo02.f90
index 62dbd4b0a024..0125467a9f2a 100644
--- a/flang/test/Semantics/canondo02.f90
+++ b/flang/test/Semantics/canondo02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/canondo03.f90 b/flang/test/Semantics/canondo03.f90
index 4be30775221e..94ab11cc39ee 100644
--- a/flang/test/Semantics/canondo03.f90
+++ b/flang/test/Semantics/canondo03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/canondo04.f90 b/flang/test/Semantics/canondo04.f90
index 452d77d0559e..65a79d0b491d 100644
--- a/flang/test/Semantics/canondo04.f90
+++ b/flang/test/Semantics/canondo04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK-NOT: do [1-9]
 

diff  --git a/flang/test/Semantics/canondo05.f90 b/flang/test/Semantics/canondo05.f90
index 4550e9849fc4..fe23091b5964 100644
--- a/flang/test/Semantics/canondo05.f90
+++ b/flang/test/Semantics/canondo05.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! XXXEXEC: ${F18} -fopenmp -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK-NOT: do *[1-9]

diff  --git a/flang/test/Semantics/canondo06.f90 b/flang/test/Semantics/canondo06.f90
index 0aea3daed4f9..a429873a1af3 100644
--- a/flang/test/Semantics/canondo06.f90
+++ b/flang/test/Semantics/canondo06.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -fopenmp -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK-NOT: do *[1-9]
 ! CHECK: omp simd

diff  --git a/flang/test/Semantics/canondo07.f90 b/flang/test/Semantics/canondo07.f90
index f5a0feef93d0..b12b8bb60720 100644
--- a/flang/test/Semantics/canondo07.f90
+++ b/flang/test/Semantics/canondo07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1131
 

diff  --git a/flang/test/Semantics/canondo08.f90 b/flang/test/Semantics/canondo08.f90
index c5bfb56f1288..465982f03939 100644
--- a/flang/test/Semantics/canondo08.f90
+++ b/flang/test/Semantics/canondo08.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo09.f90 b/flang/test/Semantics/canondo09.f90
index 99956a03fe3d..6c76ac2c1a68 100644
--- a/flang/test/Semantics/canondo09.f90
+++ b/flang/test/Semantics/canondo09.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo10.f90 b/flang/test/Semantics/canondo10.f90
index 93d060dd9aaa..adb658280e80 100644
--- a/flang/test/Semantics/canondo10.f90
+++ b/flang/test/Semantics/canondo10.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo11.f90 b/flang/test/Semantics/canondo11.f90
index 8e98a24bb87f..2ff61eb9682f 100644
--- a/flang/test/Semantics/canondo11.f90
+++ b/flang/test/Semantics/canondo11.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo12.f90 b/flang/test/Semantics/canondo12.f90
index 48fde32faf99..bbc73482342b 100644
--- a/flang/test/Semantics/canondo12.f90
+++ b/flang/test/Semantics/canondo12.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo13.f90 b/flang/test/Semantics/canondo13.f90
index b317d7963aa3..a1278460017e 100644
--- a/flang/test/Semantics/canondo13.f90
+++ b/flang/test/Semantics/canondo13.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo14.f90 b/flang/test/Semantics/canondo14.f90
index 69bd748212be..c504468a0a03 100644
--- a/flang/test/Semantics/canondo14.f90
+++ b/flang/test/Semantics/canondo14.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo15.f90 b/flang/test/Semantics/canondo15.f90
index f58959898345..6b52769d8c4a 100644
--- a/flang/test/Semantics/canondo15.f90
+++ b/flang/test/Semantics/canondo15.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo16.f90 b/flang/test/Semantics/canondo16.f90
index 8eebde23b22f..a8dfc91fa011 100644
--- a/flang/test/Semantics/canondo16.f90
+++ b/flang/test/Semantics/canondo16.f90
@@ -1,11 +1,11 @@
-! RUN: %S/test_any.sh %s %f18 %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 
 ! By default, this is not an error and label do are rewritten to non-label do.
 ! A warning is generated with -Mstandard
 
-! EXEC: ${F18} -funparse-with-symbols -Mstandard -I../../include/flang %s 2>&1 | ${FileCheck} %s
+! EXEC: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s
 
 ! CHECK: end do
 

diff  --git a/flang/test/Semantics/canondo17.f90 b/flang/test/Semantics/canondo17.f90
index a687fb2fefac..c5e87e266efe 100644
--- a/flang/test/Semantics/canondo17.f90
+++ b/flang/test/Semantics/canondo17.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo18.f90 b/flang/test/Semantics/canondo18.f90
index 3e3f18b05174..d5b18e3e1b4d 100644
--- a/flang/test/Semantics/canondo18.f90
+++ b/flang/test/Semantics/canondo18.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1133
 

diff  --git a/flang/test/Semantics/canondo19.f90 b/flang/test/Semantics/canondo19.f90
index 82bad39e950f..5b38a1909811 100644
--- a/flang/test/Semantics/canondo19.f90
+++ b/flang/test/Semantics/canondo19.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Check that if there is a label or a name on an label-do-stmt,
 ! then it is not lost when rewriting it to an non-label-do-stmt.
 

diff  --git a/flang/test/Semantics/case01.f90 b/flang/test/Semantics/case01.f90
index 7e5efc6a45a8..fc85ee7091b6 100644
--- a/flang/test/Semantics/case01.f90
+++ b/flang/test/Semantics/case01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test SELECT CASE Constraints: C1145, C1146, C1147, C1148, C1149
 program selectCaseProg
    implicit none

diff  --git a/flang/test/Semantics/coarrays01.f90 b/flang/test/Semantics/coarrays01.f90
index c96e76ceebbd..5b8c7e5e509b 100644
--- a/flang/test/Semantics/coarrays01.f90
+++ b/flang/test/Semantics/coarrays01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test selector and team-value in CHANGE TEAM statement
 
 ! OK

diff  --git a/flang/test/Semantics/common.sh b/flang/test/Semantics/common.sh
index f52c4e6464e1..ac2dab7ac075 100644
--- a/flang/test/Semantics/common.sh
+++ b/flang/test/Semantics/common.sh
@@ -1,25 +1,25 @@
 # Common functionality for test scripts
 # Process arguments, expecting source file as 1st; optional path to f18 as 2nd
-# Set: $F18 to the path to f18; $temp to an empty temp directory; $src
-# to the full path of the single source argument; and $USER_OPTIONS to the
-# option list given in the $src file after string "OPTIONS:"
+# Set: $F18 to the path to f18 with options; $temp to an empty temp directory;
+# and $src to the full path of the single source argument.
 
 function die {
   echo "$(basename $0): $*" >&2
   exit 1
 }
 if [[ $# < 3 ]]; then
-  echo "Usage: $(basename $0) <fortran-source> <f18-executable> <temp test dir>"
+  echo "Usage: $(basename $0) <fortran-source> <temp test dir> <f18-command>"
   exit 1
 fi
 
 case $1 in
-  (/*) src=$1 ;;
-  (*) src=$(dirname $0)/$1 ;;
+  (/*) src="$1" ;;
+  (*) src="$(dirname $0)/$1" ;;
 esac
-USER_OPTIONS=`sed -n 's/^ *! *OPTIONS: *//p' $src`
-echo $USER_OPTIONS
-F18=$2
-[[ ! -f $F18 ]] && die "f18 executable not found: $F18"
-temp=$3
+shift
+temp=$1
 mkdir -p $temp
+shift
+
+[[ ! -f $1 ]] && die "f18 executable not found: $1"
+F18="$*"

diff  --git a/flang/test/Semantics/complex01.f90 b/flang/test/Semantics/complex01.f90
index 060760ff6e5a..8049a132c272 100644
--- a/flang/test/Semantics/complex01.f90
+++ b/flang/test/Semantics/complex01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C718 Each named constant in a complex literal constant shall be of type 
 ! integer or real.
 subroutine s()

diff  --git a/flang/test/Semantics/computed-goto01.f90 b/flang/test/Semantics/computed-goto01.f90
index ff38b729608c..c2b4337d7ca4 100644
--- a/flang/test/Semantics/computed-goto01.f90
+++ b/flang/test/Semantics/computed-goto01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that a basic computed goto compiles
 
 INTEGER, DIMENSION (2) :: B

diff  --git a/flang/test/Semantics/computed-goto02.f90 b/flang/test/Semantics/computed-goto02.f90
index aaca63ab3bad..bb0f89518998 100644
--- a/flang/test/Semantics/computed-goto02.f90
+++ b/flang/test/Semantics/computed-goto02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that computed goto express must be a scalar integer expression
 ! TODO: PGI, for example, accepts a float & converts the value to int.
 

diff  --git a/flang/test/Semantics/critical01.f90 b/flang/test/Semantics/critical01.f90
index 1fa2553a5d9a..5e28c7378f61 100644
--- a/flang/test/Semantics/critical01.f90
+++ b/flang/test/Semantics/critical01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !C1117
 
 subroutine test1(a, i)

diff  --git a/flang/test/Semantics/critical02.f90 b/flang/test/Semantics/critical02.f90
index a339c46c3192..ae329ebf2660 100644
--- a/flang/test/Semantics/critical02.f90
+++ b/flang/test/Semantics/critical02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !C1118
 
 subroutine test1

diff  --git a/flang/test/Semantics/critical03.f90 b/flang/test/Semantics/critical03.f90
index 2964a3b5321f..5c469ea46e29 100644
--- a/flang/test/Semantics/critical03.f90
+++ b/flang/test/Semantics/critical03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !C1119
 
 subroutine test1(a, i)

diff  --git a/flang/test/Semantics/critical04.f90 b/flang/test/Semantics/critical04.f90
index 136e31baa621..888461b9ebba 100644
--- a/flang/test/Semantics/critical04.f90
+++ b/flang/test/Semantics/critical04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK-NOT: Control flow escapes from CRITICAL
 

diff  --git a/flang/test/Semantics/data01.f90 b/flang/test/Semantics/data01.f90
index 1c8608993868..0632013a36b5 100644
--- a/flang/test/Semantics/data01.f90
+++ b/flang/test/Semantics/data01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !Test for checking data constraints, C882-C887
 module m1
   type person

diff  --git a/flang/test/Semantics/data02.f90 b/flang/test/Semantics/data02.f90
index 361f3a2793a3..0d20f1c4f043 100644
--- a/flang/test/Semantics/data02.f90
+++ b/flang/test/Semantics/data02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that expressions are analyzed in data statements
 
 subroutine s1

diff  --git a/flang/test/Semantics/data03.f90 b/flang/test/Semantics/data03.f90
index 25e6fb01b3b9..62a55cff7d07 100644
--- a/flang/test/Semantics/data03.f90
+++ b/flang/test/Semantics/data03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !Testing data constraints : C874 - C875, C878 - C881 
 module m
     integer, target :: modarray(1)

diff  --git a/flang/test/Semantics/deallocate01.f90 b/flang/test/Semantics/deallocate01.f90
index 9aa69e77876d..10ae941ec569 100644
--- a/flang/test/Semantics/deallocate01.f90
+++ b/flang/test/Semantics/deallocate01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test that DEALLOCATE works
 
 INTEGER, PARAMETER :: maxvalue=1024

diff  --git a/flang/test/Semantics/deallocate04.f90 b/flang/test/Semantics/deallocate04.f90
index ce9acf994684..a5a74319c80d 100644
--- a/flang/test/Semantics/deallocate04.f90
+++ b/flang/test/Semantics/deallocate04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for type errors in DEALLOCATE statements
 
 INTEGER, PARAMETER :: maxvalue=1024

diff  --git a/flang/test/Semantics/deallocate05.f90 b/flang/test/Semantics/deallocate05.f90
index 862d88578b5f..7524cc88fe0b 100644
--- a/flang/test/Semantics/deallocate05.f90
+++ b/flang/test/Semantics/deallocate05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in DEALLOCATE statements
 
 Module share

diff  --git a/flang/test/Semantics/doconcurrent01.f90 b/flang/test/Semantics/doconcurrent01.f90
index 7a3f9c078e00..c93206853393 100644
--- a/flang/test/Semantics/doconcurrent01.f90
+++ b/flang/test/Semantics/doconcurrent01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1141
 ! A reference to the procedure IEEE_SET_HALTING_MODE ! from the intrinsic 
 ! module IEEE_EXCEPTIONS, shall not ! appear within a DO CONCURRENT construct.

diff  --git a/flang/test/Semantics/doconcurrent02.f90 b/flang/test/Semantics/doconcurrent02.f90
index db120b62bc45..bb599bd0aee3 100644
--- a/flang/test/Semantics/doconcurrent02.f90
+++ b/flang/test/Semantics/doconcurrent02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative tests: we don't want DO CONCURRENT semantics constraints checked
 ! when the loops are not DO CONCURRENT
 

diff  --git a/flang/test/Semantics/doconcurrent03.f90 b/flang/test/Semantics/doconcurrent03.f90
index cfefd92cc3b0..1ba96b577723 100644
--- a/flang/test/Semantics/doconcurrent03.f90
+++ b/flang/test/Semantics/doconcurrent03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: Control flow escapes from DO CONCURRENT
 ! CHECK: branch into loop body from outside

diff  --git a/flang/test/Semantics/doconcurrent04.f90 b/flang/test/Semantics/doconcurrent04.f90
index 51ec5737a154..cc73d3fdd8bf 100644
--- a/flang/test/Semantics/doconcurrent04.f90
+++ b/flang/test/Semantics/doconcurrent04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! C1122 The index-name shall be a named scalar variable of type integer.
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: Must have INTEGER type, but is REAL\\(4\\)

diff  --git a/flang/test/Semantics/doconcurrent05.f90 b/flang/test/Semantics/doconcurrent05.f90
index df548f23e8b5..693320b89bcf 100644
--- a/flang/test/Semantics/doconcurrent05.f90
+++ b/flang/test/Semantics/doconcurrent05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if 
 ! it belongs to that construct or an outer construct.
 

diff  --git a/flang/test/Semantics/doconcurrent06.f90 b/flang/test/Semantics/doconcurrent06.f90
index e20a830f5d80..d12bd4742e54 100644
--- a/flang/test/Semantics/doconcurrent06.f90
+++ b/flang/test/Semantics/doconcurrent06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if 
 ! it belongs to that construct or an outer construct.
 

diff  --git a/flang/test/Semantics/doconcurrent07.f90 b/flang/test/Semantics/doconcurrent07.f90
index 661d51a71be5..5882c130bb1b 100644
--- a/flang/test/Semantics/doconcurrent07.f90
+++ b/flang/test/Semantics/doconcurrent07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK-NOT: exit from DO CONCURRENT construct
 

diff  --git a/flang/test/Semantics/doconcurrent08.f90 b/flang/test/Semantics/doconcurrent08.f90
index 826bc84b20ae..b2687b049396 100644
--- a/flang/test/Semantics/doconcurrent08.f90
+++ b/flang/test/Semantics/doconcurrent08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1140 -- A statement that might result in the deallocation of a polymorphic 
 ! entity shall not appear within a DO CONCURRENT construct.
 module m1

diff  --git a/flang/test/Semantics/dosemantics01.f90 b/flang/test/Semantics/dosemantics01.f90
index 55eae4582396..f5a3ab89a002 100644
--- a/flang/test/Semantics/dosemantics01.f90
+++ b/flang/test/Semantics/dosemantics01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1131 -- check valid and invalid DO loop naming
 
 PROGRAM C1131

diff  --git a/flang/test/Semantics/dosemantics02.f90 b/flang/test/Semantics/dosemantics02.f90
index c40d3b842dbd..57f66817e394 100644
--- a/flang/test/Semantics/dosemantics02.f90
+++ b/flang/test/Semantics/dosemantics02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1121 -- any procedure referenced in a concurrent header must be pure
 
 ! Also, check that the step expressions are not zero.  This is prohibited by

diff  --git a/flang/test/Semantics/dosemantics03.f90 b/flang/test/Semantics/dosemantics03.f90
index f82a7e4879f7..b45dc8ca0c84 100644
--- a/flang/test/Semantics/dosemantics03.f90
+++ b/flang/test/Semantics/dosemantics03.f90
@@ -1,4 +1,5 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18 -Mstandard -Werror
+
 ! Issue 458 -- semantic checks for a normal DO loop.  The DO variable
 ! and the initial, final, and step expressions must be INTEGER if the
 ! options for standard conformance and turning warnings into errors
@@ -7,8 +8,6 @@
 ! messages for the cases where REAL and DOUBLE PRECISION variables
 ! and expressions are used in the DO controls.
 
-!OPTIONS: -Mstandard -Werror
-
 ! C1120 -- DO variable (and associated expressions) must be INTEGER.
 ! This is extended by allowing REAL and DOUBLE PRECISION
 

diff  --git a/flang/test/Semantics/dosemantics04.f90 b/flang/test/Semantics/dosemantics04.f90
index 80bccf59d55e..6d844e6ce2af 100644
--- a/flang/test/Semantics/dosemantics04.f90
+++ b/flang/test/Semantics/dosemantics04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1123 -- Expressions in DO CONCURRENT header cannot reference variables
 ! declared in the same header
 PROGRAM dosemantics04

diff  --git a/flang/test/Semantics/dosemantics05.f90 b/flang/test/Semantics/dosemantics05.f90
index 4e660498e3a3..e23a221940dc 100644
--- a/flang/test/Semantics/dosemantics05.f90
+++ b/flang/test/Semantics/dosemantics05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test DO loop semantics for constraint C1130 --
 ! The constraint states that "If the locality-spec DEFAULT ( NONE ) appears in a
 ! DO CONCURRENT statement; a variable that is a local or construct entity of a

diff  --git a/flang/test/Semantics/dosemantics06.f90 b/flang/test/Semantics/dosemantics06.f90
index 445eadcec6ca..70a90af742e1 100644
--- a/flang/test/Semantics/dosemantics06.f90
+++ b/flang/test/Semantics/dosemantics06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1131, C1133 -- check valid and invalid DO loop naming
 ! C1131 (R1119) If the do-stmt of a do-construct specifies a do-construct-name,
 ! the corresponding end-do shall be an end-do-stmt specifying the same

diff  --git a/flang/test/Semantics/dosemantics07.f90 b/flang/test/Semantics/dosemantics07.f90
index 95584075e2cc..0ecc1550f306 100644
--- a/flang/test/Semantics/dosemantics07.f90
+++ b/flang/test/Semantics/dosemantics07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !C1132
 ! If the do-stmt is a nonlabel-do-stmt, the corresponding end-do shall be an
 ! end-do-stmt.

diff  --git a/flang/test/Semantics/dosemantics08.f90 b/flang/test/Semantics/dosemantics08.f90
index 431443a11a80..85a2e953fdf9 100644
--- a/flang/test/Semantics/dosemantics08.f90
+++ b/flang/test/Semantics/dosemantics08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1138 -- 
 ! A branch (11.2) within a DO CONCURRENT construct shall not have a branch
 ! target that is outside the construct.

diff  --git a/flang/test/Semantics/dosemantics09.f90 b/flang/test/Semantics/dosemantics09.f90
index 3d53e39ff3ee..7f60c62eab31 100644
--- a/flang/test/Semantics/dosemantics09.f90
+++ b/flang/test/Semantics/dosemantics09.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !C1129 
 !A variable that is referenced by the scalar-mask-expr of a
 !concurrent-header or by any concurrent-limit or concurrent-step in that

diff  --git a/flang/test/Semantics/dosemantics10.f90 b/flang/test/Semantics/dosemantics10.f90
index 3d813184a3b4..91f5eeee1a68 100644
--- a/flang/test/Semantics/dosemantics10.f90
+++ b/flang/test/Semantics/dosemantics10.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1134 A CYCLE statement must be within a DO construct
 !
 ! C1166 An EXIT statement must be within a DO construct

diff  --git a/flang/test/Semantics/dosemantics11.f90 b/flang/test/Semantics/dosemantics11.f90
index 226f0073f9a4..cfee63246e73 100644
--- a/flang/test/Semantics/dosemantics11.f90
+++ b/flang/test/Semantics/dosemantics11.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1135 A cycle-stmt shall not appear within a CHANGE TEAM, CRITICAL, or DO 
 ! CONCURRENT construct if it belongs to an outer construct.
 !

diff  --git a/flang/test/Semantics/dosemantics12.f90 b/flang/test/Semantics/dosemantics12.f90
index 4cd406e0892b..7d65c0a6338c 100644
--- a/flang/test/Semantics/dosemantics12.f90
+++ b/flang/test/Semantics/dosemantics12.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.
 !
 ! Licensed under the Apache License, Version 2.0 (the "License");

diff  --git a/flang/test/Semantics/entry01.f90 b/flang/test/Semantics/entry01.f90
index f458ef515451..1e1d82ff44cd 100644
--- a/flang/test/Semantics/entry01.f90
+++ b/flang/test/Semantics/entry01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests valid and invalid ENTRY statements
 
 module m1

diff  --git a/flang/test/Semantics/equivalence01.f90 b/flang/test/Semantics/equivalence01.f90
index 68b2cd4d38ef..219eb17f27d4 100644
--- a/flang/test/Semantics/equivalence01.f90
+++ b/flang/test/Semantics/equivalence01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   integer i, j
   real r(2)

diff  --git a/flang/test/Semantics/expr-errors01.f90 b/flang/test/Semantics/expr-errors01.f90
index 36064553684c..a3ebad1d0561 100644
--- a/flang/test/Semantics/expr-errors01.f90
+++ b/flang/test/Semantics/expr-errors01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1003 - can't parenthesize function call returning procedure pointer
 module m1
   type :: dt

diff  --git a/flang/test/Semantics/expr-errors02.f90 b/flang/test/Semantics/expr-errors02.f90
index af51e1c3ee48..af6c531a9a14 100644
--- a/flang/test/Semantics/expr-errors02.f90
+++ b/flang/test/Semantics/expr-errors02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test specification expressions
 
 module m

diff  --git a/flang/test/Semantics/forall01.f90 b/flang/test/Semantics/forall01.f90
index f4652370bd18..2dec64546919 100644
--- a/flang/test/Semantics/forall01.f90
+++ b/flang/test/Semantics/forall01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine forall1
   real :: a(9)
   !ERROR: 'i' is already declared in this scoping unit

diff  --git a/flang/test/Semantics/getdefinition01.f90 b/flang/test/Semantics/getdefinition01.f90
index 4a2fdd760568..3130246c0022 100644
--- a/flang/test/Semantics/getdefinition01.f90
+++ b/flang/test/Semantics/getdefinition01.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-definition returning source position of symbol definition.
 module m1
  private :: f

diff  --git a/flang/test/Semantics/getdefinition02.f b/flang/test/Semantics/getdefinition02.f
index 58391a27d530..430c01e4e5ef 100644
--- a/flang/test/Semantics/getdefinition02.f
+++ b/flang/test/Semantics/getdefinition02.f
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-definition with fixed form.
       module m2
        private :: f

diff  --git a/flang/test/Semantics/getdefinition03-a.f90 b/flang/test/Semantics/getdefinition03-a.f90
index 81ad276ec29a..4111166d5f8a 100644
--- a/flang/test/Semantics/getdefinition03-a.f90
+++ b/flang/test/Semantics/getdefinition03-a.f90
@@ -1,5 +1,5 @@
 ! Tests -fget-definition with INCLUDE
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 INCLUDE "Inputs/getdefinition03-b.f90"
 
 program main

diff  --git a/flang/test/Semantics/getdefinition04.f90 b/flang/test/Semantics/getdefinition04.f90
index aa143a161852..ab9564e28f4c 100644
--- a/flang/test/Semantics/getdefinition04.f90
+++ b/flang/test/Semantics/getdefinition04.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-definition with COMMON block with same name as variable.
 program main
   integer :: x

diff  --git a/flang/test/Semantics/getdefinition05.f90 b/flang/test/Semantics/getdefinition05.f90
index e1115a245611..81a5b605d028 100644
--- a/flang/test/Semantics/getdefinition05.f90
+++ b/flang/test/Semantics/getdefinition05.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources with BLOCK that contains same variable name as 
 ! another in an outer scope.
 program main

diff  --git a/flang/test/Semantics/getsymbols01.f90 b/flang/test/Semantics/getsymbols01.f90
index d102807ed482..8142e43d3a71 100644
--- a/flang/test/Semantics/getsymbols01.f90
+++ b/flang/test/Semantics/getsymbols01.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources finding all symbols in file.
 module mm1
  private :: f

diff  --git a/flang/test/Semantics/getsymbols02.f90 b/flang/test/Semantics/getsymbols02.f90
index 4172b7418f9e..86f10911a945 100644
--- a/flang/test/Semantics/getsymbols02.f90
+++ b/flang/test/Semantics/getsymbols02.f90
@@ -1 +1 @@
-!RUN: %S/test_any.sh '%S/Inputs/getsymbols02-*' %f18 %t
\ No newline at end of file
+!RUN: %S/test_any.sh '%S/Inputs/getsymbols02-*' %t %f18

diff  --git a/flang/test/Semantics/getsymbols03-a.f90 b/flang/test/Semantics/getsymbols03-a.f90
index 5616f97629ce..51199ce24eb2 100644
--- a/flang/test/Semantics/getsymbols03-a.f90
+++ b/flang/test/Semantics/getsymbols03-a.f90
@@ -1,5 +1,5 @@
 ! Tests -fget-symbols with INCLUDE
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 INCLUDE "Inputs/getsymbols03-b.f90"
 
 program main

diff  --git a/flang/test/Semantics/getsymbols04.f90 b/flang/test/Semantics/getsymbols04.f90
index 06f739c71137..e0d3a40f4e20 100644
--- a/flang/test/Semantics/getsymbols04.f90
+++ b/flang/test/Semantics/getsymbols04.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources with COMMON.
 program main
   integer :: x

diff  --git a/flang/test/Semantics/getsymbols05.f90 b/flang/test/Semantics/getsymbols05.f90
index f905313675cd..36bf61b4e738 100644
--- a/flang/test/Semantics/getsymbols05.f90
+++ b/flang/test/Semantics/getsymbols05.f90
@@ -1,4 +1,4 @@
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources with COMMON.
 program main
   integer :: x

diff  --git a/flang/test/Semantics/if_arith01.f90 b/flang/test/Semantics/if_arith01.f90
index 16e616fc5a0d..abce953a330a 100644
--- a/flang/test/Semantics/if_arith01.f90
+++ b/flang/test/Semantics/if_arith01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that a basic arithmetic if compiles.
 
 if ( A ) 100, 200, 300

diff  --git a/flang/test/Semantics/if_arith02.f90 b/flang/test/Semantics/if_arith02.f90
index 4dfe72d36a5d..06cf4232bc95 100644
--- a/flang/test/Semantics/if_arith02.f90
+++ b/flang/test/Semantics/if_arith02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that only labels are allowed in arithmetic if statements.
 ! TODO: Revisit error message "expected 'ASSIGN'" etc.
 ! TODO: Revisit error message "expected one of '0123456789'"

diff  --git a/flang/test/Semantics/if_arith03.f90 b/flang/test/Semantics/if_arith03.f90
index a9a3e5010b02..e4ace9288098 100644
--- a/flang/test/Semantics/if_arith03.f90
+++ b/flang/test/Semantics/if_arith03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 
 !ERROR: Label '600' was not found

diff  --git a/flang/test/Semantics/if_arith04.f90 b/flang/test/Semantics/if_arith04.f90
index d947b0b1a7b0..f2be27b09270 100644
--- a/flang/test/Semantics/if_arith04.f90
+++ b/flang/test/Semantics/if_arith04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Make sure arithmetic if expressions are non-complex numeric exprs.
 
 INTEGER I

diff  --git a/flang/test/Semantics/if_construct01.f90 b/flang/test/Semantics/if_construct01.f90
index adac3c252cc2..0ca70902e4a5 100644
--- a/flang/test/Semantics/if_construct01.f90
+++ b/flang/test/Semantics/if_construct01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Simple check that if constructs are ok.
 
 if (a < b) then

diff  --git a/flang/test/Semantics/if_construct02.f90 b/flang/test/Semantics/if_construct02.f90
index de9428649937..74ef5febb289 100644
--- a/flang/test/Semantics/if_construct02.f90
+++ b/flang/test/Semantics/if_construct02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that if constructs only accept scalar logical expressions.
 ! TODO: expand the test to check this restriction for more types.
 

diff  --git a/flang/test/Semantics/if_stmt01.f90 b/flang/test/Semantics/if_stmt01.f90
index 337d5190e329..12a3d50efa6a 100644
--- a/flang/test/Semantics/if_stmt01.f90
+++ b/flang/test/Semantics/if_stmt01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Simple check that if statements are ok.
 
 IF (A > 0.0) A = LOG (A)

diff  --git a/flang/test/Semantics/if_stmt02.f90 b/flang/test/Semantics/if_stmt02.f90
index 5672811c4670..08c07c039aa8 100644
--- a/flang/test/Semantics/if_stmt02.f90
+++ b/flang/test/Semantics/if_stmt02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !ERROR: IF statement is not allowed in IF statement
 IF (A > 0.0) IF (B < 0.0) A = LOG (A)
 END

diff  --git a/flang/test/Semantics/if_stmt03.f90 b/flang/test/Semantics/if_stmt03.f90
index 970b70e00889..5da1c4e3588c 100644
--- a/flang/test/Semantics/if_stmt03.f90
+++ b/flang/test/Semantics/if_stmt03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check that non-logical expressions are not allowed.
 ! Check that non-scalar expressions are not allowed.
 ! TODO: Insure all non-logicals are prohibited.

diff  --git a/flang/test/Semantics/implicit01.f90 b/flang/test/Semantics/implicit01.f90
index 5cc8709a4dfd..c8c268fffcd4 100644
--- a/flang/test/Semantics/implicit01.f90
+++ b/flang/test/Semantics/implicit01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   implicit none
   !ERROR: More than one IMPLICIT NONE statement

diff  --git a/flang/test/Semantics/implicit02.f90 b/flang/test/Semantics/implicit02.f90
index f30170587cf0..282fb9a5d1f2 100644
--- a/flang/test/Semantics/implicit02.f90
+++ b/flang/test/Semantics/implicit02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   implicit none
   !ERROR: IMPLICIT statement after IMPLICIT NONE or IMPLICIT NONE(TYPE) statement

diff  --git a/flang/test/Semantics/implicit03.f90 b/flang/test/Semantics/implicit03.f90
index bb6c4958da2d..0d937a95cb06 100644
--- a/flang/test/Semantics/implicit03.f90
+++ b/flang/test/Semantics/implicit03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   implicit integer(a-z)
   !ERROR: IMPLICIT NONE statement after IMPLICIT statement

diff  --git a/flang/test/Semantics/implicit04.f90 b/flang/test/Semantics/implicit04.f90
index 20de8c403037..d8430b6fca20 100644
--- a/flang/test/Semantics/implicit04.f90
+++ b/flang/test/Semantics/implicit04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s
   parameter(a=1.0)
   !ERROR: IMPLICIT NONE statement after PARAMETER statement

diff  --git a/flang/test/Semantics/implicit05.f90 b/flang/test/Semantics/implicit05.f90
index e6dec7d61533..6f7380dfd354 100644
--- a/flang/test/Semantics/implicit05.f90
+++ b/flang/test/Semantics/implicit05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s
   !ERROR: 'a' does not follow 'b' alphabetically
   implicit integer(b-a)

diff  --git a/flang/test/Semantics/implicit06.f90 b/flang/test/Semantics/implicit06.f90
index 9f54282c2fd5..5c8e0e1d798b 100644
--- a/flang/test/Semantics/implicit06.f90
+++ b/flang/test/Semantics/implicit06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   implicit integer(a-c)
   !ERROR: More than one implicit type specified for 'c'

diff  --git a/flang/test/Semantics/implicit07.f90 b/flang/test/Semantics/implicit07.f90
index 5ec659233f85..df015f7bcc62 100644
--- a/flang/test/Semantics/implicit07.f90
+++ b/flang/test/Semantics/implicit07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 implicit none(external)
 external x
 call x

diff  --git a/flang/test/Semantics/implicit08.f90 b/flang/test/Semantics/implicit08.f90
index a4a1c33fb233..b1b33bae16fe 100644
--- a/flang/test/Semantics/implicit08.f90
+++ b/flang/test/Semantics/implicit08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   block
     !ERROR: IMPLICIT statement is not allowed in a BLOCK construct

diff  --git a/flang/test/Semantics/init01.f90 b/flang/test/Semantics/init01.f90
index f8481506a809..8f8b59d26a6c 100644
--- a/flang/test/Semantics/init01.f90
+++ b/flang/test/Semantics/init01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Object pointer initializer error tests
 
 subroutine test(j)

diff  --git a/flang/test/Semantics/int-literals.f90 b/flang/test/Semantics/int-literals.f90
index 01d31c5c0ca6..125b2051d36c 100644
--- a/flang/test/Semantics/int-literals.f90
+++ b/flang/test/Semantics/int-literals.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Fortran syntax considers signed int literals in complex literals
 ! to be a distinct production, not an application of unary +/- to
 ! an unsigned int literal, so they're used here to test overflow

diff  --git a/flang/test/Semantics/io01.f90 b/flang/test/Semantics/io01.f90
index 56936b6e68fe..4238df89f5d0 100644
--- a/flang/test/Semantics/io01.f90
+++ b/flang/test/Semantics/io01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   character(len=20) :: access = "direcT"
   character(len=20) :: access_(2) = (/"direcT", "streaM"/)
   character(len=20) :: action_(2) = (/"reaD ", "writE"/)

diff  --git a/flang/test/Semantics/io02.f90 b/flang/test/Semantics/io02.f90
index a405f3e91502..5fd5fca4bc0c 100644
--- a/flang/test/Semantics/io02.f90
+++ b/flang/test/Semantics/io02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   integer :: unit10 = 10
   integer :: unit11 = 11
 

diff  --git a/flang/test/Semantics/io03.f90 b/flang/test/Semantics/io03.f90
index 6c91afc00b01..0041e6cd0f5c 100644
--- a/flang/test/Semantics/io03.f90
+++ b/flang/test/Semantics/io03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   character(kind=1,len=50) internal_file
   character(kind=2,len=50) internal_file2
   character(kind=4,len=50) internal_file4

diff  --git a/flang/test/Semantics/io04.f90 b/flang/test/Semantics/io04.f90
index 5cda7fff8bc8..0a37d685d3ee 100644
--- a/flang/test/Semantics/io04.f90
+++ b/flang/test/Semantics/io04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   character(kind=1,len=50) internal_file
   character(kind=1,len=100) msg
   character(20) sign

diff  --git a/flang/test/Semantics/io05.f90 b/flang/test/Semantics/io05.f90
index 8d10ab12416d..1501fbf587f5 100644
--- a/flang/test/Semantics/io05.f90
+++ b/flang/test/Semantics/io05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   character*20 c(25), cv
   character(kind=1,len=59) msg
   logical*2 v(5), lv

diff  --git a/flang/test/Semantics/io06.f90 b/flang/test/Semantics/io06.f90
index 1b19fc6bc217..157d831dc333 100644
--- a/flang/test/Semantics/io06.f90
+++ b/flang/test/Semantics/io06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   character(kind=1,len=100) msg1
   character(kind=2,len=200) msg2
   integer(1) stat1

diff  --git a/flang/test/Semantics/io07.f90 b/flang/test/Semantics/io07.f90
index e3154689ab80..6f8c9be80f35 100644
--- a/flang/test/Semantics/io07.f90
+++ b/flang/test/Semantics/io07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 1001 format(A)
 
      !ERROR: Format statement must be labeled

diff  --git a/flang/test/Semantics/io08.f90 b/flang/test/Semantics/io08.f90
index ca9638fb3a3f..491f0ad7abad 100644
--- a/flang/test/Semantics/io08.f90
+++ b/flang/test/Semantics/io08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   write(*,*)
   write(*,'()')
   write(*,'(A)')

diff  --git a/flang/test/Semantics/io09.f90 b/flang/test/Semantics/io09.f90
index 7ce5e6435568..ce52aab82d18 100644
--- a/flang/test/Semantics/io09.f90
+++ b/flang/test/Semantics/io09.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
   !ERROR: String edit descriptor in READ format expression
   read(*,'("abc")')
 

diff  --git a/flang/test/Semantics/io10.f90 b/flang/test/Semantics/io10.f90
index a3023861c1cf..4b56f51ec550 100644
--- a/flang/test/Semantics/io10.f90
+++ b/flang/test/Semantics/io10.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -Mstandard
+! RUN: %S/test_errors.sh %s %t %f18 -Mstandard
 
   write(*, '(B0)')
   write(*, '(B3)')

diff  --git a/flang/test/Semantics/kinds01.f90 b/flang/test/Semantics/kinds01.f90
index 388ca2342167..18776dfc51d8 100644
--- a/flang/test/Semantics/kinds01.f90
+++ b/flang/test/Semantics/kinds01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
  !DEF: /MainProgram1/jk1 ObjectEntity INTEGER(1)
  integer(kind=1) jk1
  !DEF: /MainProgram1/js1 ObjectEntity INTEGER(1)

diff  --git a/flang/test/Semantics/kinds02.f90 b/flang/test/Semantics/kinds02.f90
index bdc998bbdfe7..9743fb646ac8 100644
--- a/flang/test/Semantics/kinds02.f90
+++ b/flang/test/Semantics/kinds02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C712 The value of scalar-int-constant-expr shall be nonnegative and 
 ! shall specify a representation method that exists on the processor.
 ! C714 The value of kind-param shall be nonnegative.

diff  --git a/flang/test/Semantics/kinds03.f90 b/flang/test/Semantics/kinds03.f90
index b4ba7e67bb6c..424a79903693 100644
--- a/flang/test/Semantics/kinds03.f90
+++ b/flang/test/Semantics/kinds03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
  !DEF: /MainProgram1/ipdt DerivedType
  !DEF: /MainProgram1/ipdt/k TypeParam INTEGER(4)
  type :: ipdt(k)

diff  --git a/flang/test/Semantics/kinds04.f90 b/flang/test/Semantics/kinds04.f90
index 54f953fec5ff..32745637fd73 100644
--- a/flang/test/Semantics/kinds04.f90
+++ b/flang/test/Semantics/kinds04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C716 If both kind-param and exponent-letter appear, exponent-letter 
 ! shall be E.
 ! C717 The value of kind-param shall specify an approximation method that 

diff  --git a/flang/test/Semantics/label01.F90 b/flang/test/Semantics/label01.F90
index e63bd547ee75..aa1b80025d84 100644
--- a/flang/test/Semantics/label01.F90
+++ b/flang/test/Semantics/label01.F90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s -o /dev/null 2>&1 | grep -v 'procedure conflicts' | ${FileCheck} %s
 ! CHECK-NOT: error:[[:space:]]
 

diff  --git a/flang/test/Semantics/label02.f90 b/flang/test/Semantics/label02.f90
index e98868106f1d..26f98e578273 100644
--- a/flang/test/Semantics/label02.f90
+++ b/flang/test/Semantics/label02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label03.f90 b/flang/test/Semantics/label03.f90
index 557bb00054b3..40eb6f391f18 100644
--- a/flang/test/Semantics/label03.f90
+++ b/flang/test/Semantics/label03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label04.f90 b/flang/test/Semantics/label04.f90
index a3f3586763ee..3180b0c23bd7 100644
--- a/flang/test/Semantics/label04.f90
+++ b/flang/test/Semantics/label04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label05.f90 b/flang/test/Semantics/label05.f90
index 94765fbee0e5..f962b03dd719 100644
--- a/flang/test/Semantics/label05.f90
+++ b/flang/test/Semantics/label05.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label06.f90 b/flang/test/Semantics/label06.f90
index 34dc4362941c..ab948e12f086 100644
--- a/flang/test/Semantics/label06.f90
+++ b/flang/test/Semantics/label06.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label07.f90 b/flang/test/Semantics/label07.f90
index f1d440a045ea..5a73c74bde22 100644
--- a/flang/test/Semantics/label07.f90
+++ b/flang/test/Semantics/label07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label08.f90 b/flang/test/Semantics/label08.f90
index 140ceb33ec68..5b5c727d0ad6 100644
--- a/flang/test/Semantics/label08.f90
+++ b/flang/test/Semantics/label08.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! negative test -- invalid labels, out of range
 
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s

diff  --git a/flang/test/Semantics/label09.f90 b/flang/test/Semantics/label09.f90
index d7e5ae304fce..d3968e4b3d6e 100644
--- a/flang/test/Semantics/label09.f90
+++ b/flang/test/Semantics/label09.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: Label '60' was not found
 

diff  --git a/flang/test/Semantics/label10.f90 b/flang/test/Semantics/label10.f90
index 377108c95dd5..dc19e5dacfc3 100644
--- a/flang/test/Semantics/label10.f90
+++ b/flang/test/Semantics/label10.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: '60' not a FORMAT
 ! CHECK: data transfer use of '60'

diff  --git a/flang/test/Semantics/label11.f90 b/flang/test/Semantics/label11.f90
index 71c40cf066d3..1e477e2a250c 100644
--- a/flang/test/Semantics/label11.f90
+++ b/flang/test/Semantics/label11.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: BLOCK DATA subprogram name mismatch
 ! CHECK: should be

diff  --git a/flang/test/Semantics/label12.f90 b/flang/test/Semantics/label12.f90
index 96607bc8e8f0..8dbe7e46ea04 100644
--- a/flang/test/Semantics/label12.f90
+++ b/flang/test/Semantics/label12.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: expected end of statement
 

diff  --git a/flang/test/Semantics/label13.f90 b/flang/test/Semantics/label13.f90
index 61501804d270..bdd5d68e66da 100644
--- a/flang/test/Semantics/label13.f90
+++ b/flang/test/Semantics/label13.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
 ! CHECK: branch into loop body from outside
 ! CHECK: the loop branched into

diff  --git a/flang/test/Semantics/label14.f90 b/flang/test/Semantics/label14.f90
index b16366819d8e..700508ab878b 100644
--- a/flang/test/Semantics/label14.f90
+++ b/flang/test/Semantics/label14.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
 ! Tests implemented for this standard
 ! 11.1.4 - 4 It is permissible to branch to and end-block-stmt only withinh its
 !            Block Construct

diff  --git a/flang/test/Semantics/misc-declarations.f90 b/flang/test/Semantics/misc-declarations.f90
index f627836b3732..fdf00dcacbbd 100644
--- a/flang/test/Semantics/misc-declarations.f90
+++ b/flang/test/Semantics/misc-declarations.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Miscellaneous constraint and requirement checking on declarations:
 ! - 8.5.6.2 & 8.5.6.3 constraints on coarrays
 ! - 8.5.19 constraints on the VOLATILE attribute

diff  --git a/flang/test/Semantics/modfile01.f90 b/flang/test/Semantics/modfile01.f90
index d3cd5273f853..1880a13f8abb 100644
--- a/flang/test/Semantics/modfile01.f90
+++ b/flang/test/Semantics/modfile01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check correct modfile generation for type with private component.
 module m
   integer :: i

diff  --git a/flang/test/Semantics/modfile02.f90 b/flang/test/Semantics/modfile02.f90
index 9f460004415d..3c3a1c64c482 100644
--- a/flang/test/Semantics/modfile02.f90
+++ b/flang/test/Semantics/modfile02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check modfile generation for private type in public API.
 
 module m

diff  --git a/flang/test/Semantics/modfile03.f90 b/flang/test/Semantics/modfile03.f90
index 9beb5308bd38..1c68d0d72d92 100644
--- a/flang/test/Semantics/modfile03.f90
+++ b/flang/test/Semantics/modfile03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check modfile generation with use-association.
 
 module m1

diff  --git a/flang/test/Semantics/modfile04.f90 b/flang/test/Semantics/modfile04.f90
index 9dbd3adfeede..b0a6847b34df 100644
--- a/flang/test/Semantics/modfile04.f90
+++ b/flang/test/Semantics/modfile04.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! modfile with subprograms
 
 module m1

diff  --git a/flang/test/Semantics/modfile05.f90 b/flang/test/Semantics/modfile05.f90
index 49e3f47d4a68..82e9629562a6 100644
--- a/flang/test/Semantics/modfile05.f90
+++ b/flang/test/Semantics/modfile05.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Use-association with VOLATILE or ASYNCHRONOUS
 
 module m1

diff  --git a/flang/test/Semantics/modfile06.f90 b/flang/test/Semantics/modfile06.f90
index 5924b67c7daa..e463834bde8d 100644
--- a/flang/test/Semantics/modfile06.f90
+++ b/flang/test/Semantics/modfile06.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check modfile generation for external interface
 module m
   interface

diff  --git a/flang/test/Semantics/modfile07.f90 b/flang/test/Semantics/modfile07.f90
index b4a49d9924e3..69fee6bcd326 100644
--- a/flang/test/Semantics/modfile07.f90
+++ b/flang/test/Semantics/modfile07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check modfile generation for generic interfaces
 module m1
   interface foo

diff  --git a/flang/test/Semantics/modfile08.f90 b/flang/test/Semantics/modfile08.f90
index 7a2e20195f2d..b87de4915e2b 100644
--- a/flang/test/Semantics/modfile08.f90
+++ b/flang/test/Semantics/modfile08.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check modfile generation for external declarations
 module m
   real, external :: a

diff  --git a/flang/test/Semantics/modfile09.f90 b/flang/test/Semantics/modfile09.f90
index ec5813b48e51..0e22f9d01e5e 100644
--- a/flang/test/Semantics/modfile09.f90
+++ b/flang/test/Semantics/modfile09.f90
@@ -1 +1 @@
-!RUN: %S/test_modfile.sh '%S/Inputs/modfile09-*' %f18 %t
+!RUN: %S/test_modfile.sh '%S/Inputs/modfile09-*' %t %f18

diff  --git a/flang/test/Semantics/modfile10.f90 b/flang/test/Semantics/modfile10.f90
index dc91d8734b19..2949ab6965dc 100644
--- a/flang/test/Semantics/modfile10.f90
+++ b/flang/test/Semantics/modfile10.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test writing procedure bindings in a derived type.
 
 module m

diff  --git a/flang/test/Semantics/modfile11.f90 b/flang/test/Semantics/modfile11.f90
index ec4dd2f88099..3259a5fb5ee6 100644
--- a/flang/test/Semantics/modfile11.f90
+++ b/flang/test/Semantics/modfile11.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   type t1(a, b, c)
     integer, kind :: a

diff  --git a/flang/test/Semantics/modfile12.f90 b/flang/test/Semantics/modfile12.f90
index ca43611984a4..fcea8fc39a59 100644
--- a/flang/test/Semantics/modfile12.f90
+++ b/flang/test/Semantics/modfile12.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   integer(8), parameter :: a = 1, b = 2_8
   parameter(n=3,l=-3,e=1.0/3.0)

diff  --git a/flang/test/Semantics/modfile13.f90 b/flang/test/Semantics/modfile13.f90
index c4fcfe71751b..8c6ce50c360b 100644
--- a/flang/test/Semantics/modfile13.f90
+++ b/flang/test/Semantics/modfile13.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   character(2) :: z
   character(len=3) :: y

diff  --git a/flang/test/Semantics/modfile14.f90 b/flang/test/Semantics/modfile14.f90
index 1c4fa0e92076..e79a99919249 100644
--- a/flang/test/Semantics/modfile14.f90
+++ b/flang/test/Semantics/modfile14.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   type t1
   contains

diff  --git a/flang/test/Semantics/modfile15.f90 b/flang/test/Semantics/modfile15.f90
index 4cc8787f5d45..6051cb7f59e9 100644
--- a/flang/test/Semantics/modfile15.f90
+++ b/flang/test/Semantics/modfile15.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   type :: t
     procedure(a), pointer, pass :: c

diff  --git a/flang/test/Semantics/modfile16.f90 b/flang/test/Semantics/modfile16.f90
index 48a302792878..c250770393cb 100644
--- a/flang/test/Semantics/modfile16.f90
+++ b/flang/test/Semantics/modfile16.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   character(2), parameter :: prefix = 'c_'
   integer, bind(c, name='c_a') :: a

diff  --git a/flang/test/Semantics/modfile17.f90 b/flang/test/Semantics/modfile17.f90
index 33767a38028c..921d2f2b6008 100644
--- a/flang/test/Semantics/modfile17.f90
+++ b/flang/test/Semantics/modfile17.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Tests parameterized derived type instantiation with KIND parameters
 
 module m

diff  --git a/flang/test/Semantics/modfile18.f90 b/flang/test/Semantics/modfile18.f90
index 032b0491045b..a242b3fc9495 100644
--- a/flang/test/Semantics/modfile18.f90
+++ b/flang/test/Semantics/modfile18.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Tests folding of array constructors
 
 module m

diff  --git a/flang/test/Semantics/modfile19.f90 b/flang/test/Semantics/modfile19.f90
index fcb10b54e9d0..78d3e73b0892 100644
--- a/flang/test/Semantics/modfile19.f90
+++ b/flang/test/Semantics/modfile19.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   implicit complex(8)(z)
   real :: x

diff  --git a/flang/test/Semantics/modfile20.f90 b/flang/test/Semantics/modfile20.f90
index a09c4422be23..a2730b1454f9 100644
--- a/flang/test/Semantics/modfile20.f90
+++ b/flang/test/Semantics/modfile20.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test modfiles for entities with initialization
 module m
   integer, parameter :: k8 = 8

diff  --git a/flang/test/Semantics/modfile21.f90 b/flang/test/Semantics/modfile21.f90
index 64dd95f868d3..f1e4036c96a8 100644
--- a/flang/test/Semantics/modfile21.f90
+++ b/flang/test/Semantics/modfile21.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m
   logical b
   bind(C) :: /cb2/

diff  --git a/flang/test/Semantics/modfile22.f90 b/flang/test/Semantics/modfile22.f90
index ea2637d4b1d4..f03621523e06 100644
--- a/flang/test/Semantics/modfile22.f90
+++ b/flang/test/Semantics/modfile22.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test character length conversions in constructors
 
 module m

diff  --git a/flang/test/Semantics/modfile23.f90 b/flang/test/Semantics/modfile23.f90
index 4b5637867e1d..828168b1810d 100644
--- a/flang/test/Semantics/modfile23.f90
+++ b/flang/test/Semantics/modfile23.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test that subprogram interfaces get all of the symbols that they need.
 
 module m1

diff  --git a/flang/test/Semantics/modfile24.f90 b/flang/test/Semantics/modfile24.f90
index 45f6c0545627..2e67e9c1cd26 100644
--- a/flang/test/Semantics/modfile24.f90
+++ b/flang/test/Semantics/modfile24.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test declarations with coarray-spec
 
 ! Different ways of declaring the same coarray.

diff  --git a/flang/test/Semantics/modfile25.f90 b/flang/test/Semantics/modfile25.f90
index 210935df2515..850298d54e4d 100644
--- a/flang/test/Semantics/modfile25.f90
+++ b/flang/test/Semantics/modfile25.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test compile-time analysis of shapes.
 
 module m1

diff  --git a/flang/test/Semantics/modfile26.f90 b/flang/test/Semantics/modfile26.f90
index 5064122a3740..d8c795b67a41 100644
--- a/flang/test/Semantics/modfile26.f90
+++ b/flang/test/Semantics/modfile26.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Intrinsics SELECTED_INT_KIND, SELECTED_REAL_KIND, PRECISION, RANGE,
 ! RADIX, DIGITS
 

diff  --git a/flang/test/Semantics/modfile27.f90 b/flang/test/Semantics/modfile27.f90
index 2a6e23f6f464..7e712cb9d3ae 100644
--- a/flang/test/Semantics/modfile27.f90
+++ b/flang/test/Semantics/modfile27.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test folding of combined array references and structure component
 ! references.
 

diff  --git a/flang/test/Semantics/modfile28.f90 b/flang/test/Semantics/modfile28.f90
index b06826ced22f..4ad06434343c 100644
--- a/flang/test/Semantics/modfile28.f90
+++ b/flang/test/Semantics/modfile28.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 
 ! Test UTF-8 support in character literals
 ! Note: Module files are encoded in UTF-8.

diff  --git a/flang/test/Semantics/modfile29.f90 b/flang/test/Semantics/modfile29.f90
index 7afa55120be1..3f9e29906268 100644
--- a/flang/test/Semantics/modfile29.f90
+++ b/flang/test/Semantics/modfile29.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Check that implicitly typed entities get a type in the module file.
 
 module m

diff  --git a/flang/test/Semantics/modfile30.f90 b/flang/test/Semantics/modfile30.f90
index a3b42629e148..01c60d5a3990 100644
--- a/flang/test/Semantics/modfile30.f90
+++ b/flang/test/Semantics/modfile30.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Verify miscellaneous bugs
 
 ! The function result must be declared after the dummy arguments

diff  --git a/flang/test/Semantics/modfile31.f90 b/flang/test/Semantics/modfile31.f90
index a29256fe46a2..ad0225432d5e 100644
--- a/flang/test/Semantics/modfile31.f90
+++ b/flang/test/Semantics/modfile31.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test 7.6 enum values
 
 module m1

diff  --git a/flang/test/Semantics/modfile32.f90 b/flang/test/Semantics/modfile32.f90
index ea5b55a94d05..f7aaecfeaf50 100644
--- a/flang/test/Semantics/modfile32.f90
+++ b/flang/test/Semantics/modfile32.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Resolution of generic names in expressions.
 ! Test by using generic function in a specification expression that needs
 ! to be written to a .mod file.

diff  --git a/flang/test/Semantics/modfile33.f90 b/flang/test/Semantics/modfile33.f90
index 361542acbc33..861c2132bc57 100644
--- a/flang/test/Semantics/modfile33.f90
+++ b/flang/test/Semantics/modfile33.f90
@@ -1,10 +1,9 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18 -flogical-abbreviations -fxor-operator
+
 ! Resolution of user-defined operators in expressions.
 ! Test by using generic function in a specification expression that needs
 ! to be written to a .mod file.
 
-!OPTIONS: -flogical-abbreviations -fxor-operator
-
 ! Numeric operators
 module m1
   type :: t

diff  --git a/flang/test/Semantics/modfile34.f90 b/flang/test/Semantics/modfile34.f90
index 59b0fd1a447f..59b27c49867b 100644
--- a/flang/test/Semantics/modfile34.f90
+++ b/flang/test/Semantics/modfile34.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 ! Test resolution of type-bound generics.
 
 module m1

diff  --git a/flang/test/Semantics/modfile35.f90 b/flang/test/Semantics/modfile35.f90
index 9ef35747e947..928b6c5472bb 100644
--- a/flang/test/Semantics/modfile35.f90
+++ b/flang/test/Semantics/modfile35.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
 module m1
   type :: t1
   contains

diff  --git a/flang/test/Semantics/namelist01.f90 b/flang/test/Semantics/namelist01.f90
index b85357faf9ae..6f5575adf2b6 100644
--- a/flang/test/Semantics/namelist01.f90
+++ b/flang/test/Semantics/namelist01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test for checking namelist constraints, C8103-C8105
 
 module dup

diff  --git a/flang/test/Semantics/null01.f90 b/flang/test/Semantics/null01.f90
index 478bedbc44ed..a034d1b7b3df 100644
--- a/flang/test/Semantics/null01.f90
+++ b/flang/test/Semantics/null01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! NULL() intrinsic function error tests
 
 subroutine test

diff  --git a/flang/test/Semantics/nullify01.f90 b/flang/test/Semantics/nullify01.f90
index 62cde3055f77..455a7b44e327 100644
--- a/flang/test/Semantics/nullify01.f90
+++ b/flang/test/Semantics/nullify01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test that NULLIFY works
 
 Module share

diff  --git a/flang/test/Semantics/nullify02.f90 b/flang/test/Semantics/nullify02.f90
index 7a2408348cd4..fccb618e376f 100644
--- a/flang/test/Semantics/nullify02.f90
+++ b/flang/test/Semantics/nullify02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Check for semantic errors in NULLIFY statements
 
 INTEGER, PARAMETER :: maxvalue=1024

diff  --git a/flang/test/Semantics/omp-atomic.f90 b/flang/test/Semantics/omp-atomic.f90
index 2a27bfaf6011..d5cb87aaba32 100644
--- a/flang/test/Semantics/omp-atomic.f90
+++ b/flang/test/Semantics/omp-atomic.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Check OpenMP 2.13.6 atomic Construct
 

diff  --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90
index bcfea4c5b250..2714f7fc4153 100644
--- a/flang/test/Semantics/omp-clause-validity01.f90
+++ b/flang/test/Semantics/omp-clause-validity01.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Check OpenMP clause validity for the following directives:
 !

diff  --git a/flang/test/Semantics/omp-combined-constructs.f90 b/flang/test/Semantics/omp-combined-constructs.f90
index c7ff9f02afbf..3a1956ef10db 100644
--- a/flang/test/Semantics/omp-combined-constructs.f90
+++ b/flang/test/Semantics/omp-combined-constructs.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 program main
   implicit none

diff  --git a/flang/test/Semantics/omp-declarative-directive.f90 b/flang/test/Semantics/omp-declarative-directive.f90
index 98787eea3031..782cee7c4446 100644
--- a/flang/test/Semantics/omp-declarative-directive.f90
+++ b/flang/test/Semantics/omp-declarative-directive.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Check OpenMP declarative directives
 

diff  --git a/flang/test/Semantics/omp-device-constructs.f90 b/flang/test/Semantics/omp-device-constructs.f90
index 23a8d3c58c65..7b3eef22524f 100644
--- a/flang/test/Semantics/omp-device-constructs.f90
+++ b/flang/test/Semantics/omp-device-constructs.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 ! Check OpenMP clause validity for the following directives:
 !     2.10 Device constructs
 program main

diff  --git a/flang/test/Semantics/omp-loop-association.f90 b/flang/test/Semantics/omp-loop-association.f90
index 036d7c3d124d..af22f62bc697 100644
--- a/flang/test/Semantics/omp-loop-association.f90
+++ b/flang/test/Semantics/omp-loop-association.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Check the association between OpenMPLoopConstruct and DoConstruct
 

diff  --git a/flang/test/Semantics/omp-nested01.f90 b/flang/test/Semantics/omp-nested01.f90
index b13f536da27f..98efa54cfaea 100644
--- a/flang/test/Semantics/omp-nested01.f90
+++ b/flang/test/Semantics/omp-nested01.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Check OpenMP 2.17 Nesting of Regions
 

diff  --git a/flang/test/Semantics/omp-resolve01.f90 b/flang/test/Semantics/omp-resolve01.f90
index 47479b4954f7..09f7b7666ce6 100644
--- a/flang/test/Semantics/omp-resolve01.f90
+++ b/flang/test/Semantics/omp-resolve01.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! 2.4 An array section designates a subset of the elements in an array. Although
 ! Substring shares similar syntax but cannot be treated as valid array section.

diff  --git a/flang/test/Semantics/omp-resolve02.f90 b/flang/test/Semantics/omp-resolve02.f90
index 3f28973a907b..7942aac9ed62 100644
--- a/flang/test/Semantics/omp-resolve02.f90
+++ b/flang/test/Semantics/omp-resolve02.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! Test the effect to name resolution from illegal clause
 

diff  --git a/flang/test/Semantics/omp-resolve03.f90 b/flang/test/Semantics/omp-resolve03.f90
index 8e20d23fafa6..8e762bb3e425 100644
--- a/flang/test/Semantics/omp-resolve03.f90
+++ b/flang/test/Semantics/omp-resolve03.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! 2.15.3 Although variables in common blocks can be accessed by use association
 ! or host association, common block names cannot. As a result, a common block

diff  --git a/flang/test/Semantics/omp-resolve04.f90 b/flang/test/Semantics/omp-resolve04.f90
index a216616eb2fd..fef6034aaa09 100644
--- a/flang/test/Semantics/omp-resolve04.f90
+++ b/flang/test/Semantics/omp-resolve04.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! 2.15.3 Data-Sharing Attribute Clauses
 ! A list item that specifies a given variable may not appear in more than

diff  --git a/flang/test/Semantics/omp-resolve05.f90 b/flang/test/Semantics/omp-resolve05.f90
index dc15b18a18db..5aaa722e8f88 100644
--- a/flang/test/Semantics/omp-resolve05.f90
+++ b/flang/test/Semantics/omp-resolve05.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
 ! 2.15.3 Data-Sharing Attribute Clauses
 ! 2.15.3.1 default Clause

diff  --git a/flang/test/Semantics/omp-symbol01.f90 b/flang/test/Semantics/omp-symbol01.f90
index 70782f3adf41..46195edfaa49 100644
--- a/flang/test/Semantics/omp-symbol01.f90
+++ b/flang/test/Semantics/omp-symbol01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! Test clauses that accept list.
 ! 2.1 Directive Format

diff  --git a/flang/test/Semantics/omp-symbol02.f90 b/flang/test/Semantics/omp-symbol02.f90
index eddb6865e88c..deccdc92afb9 100644
--- a/flang/test/Semantics/omp-symbol02.f90
+++ b/flang/test/Semantics/omp-symbol02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 1.4.1 Structure of the OpenMP Memory Model
 

diff  --git a/flang/test/Semantics/omp-symbol03.f90 b/flang/test/Semantics/omp-symbol03.f90
index 54072a1e1049..4baaabc08737 100644
--- a/flang/test/Semantics/omp-symbol03.f90
+++ b/flang/test/Semantics/omp-symbol03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 1.4.1 Structure of the OpenMP Memory Model
 ! In the inner OpenMP region, SHARED `a` refers to the `a` in the outer OpenMP

diff  --git a/flang/test/Semantics/omp-symbol04.f90 b/flang/test/Semantics/omp-symbol04.f90
index 052fa859cd32..8d1461d75543 100644
--- a/flang/test/Semantics/omp-symbol04.f90
+++ b/flang/test/Semantics/omp-symbol04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 2.15.3 Data-Sharing Attribute Clauses
 ! Both PARALLEL and DO (worksharing) directives need to create new scope,

diff  --git a/flang/test/Semantics/omp-symbol05.f90 b/flang/test/Semantics/omp-symbol05.f90
index 1a4b42e1ce32..e76b5c11b1aa 100644
--- a/flang/test/Semantics/omp-symbol05.f90
+++ b/flang/test/Semantics/omp-symbol05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 2.15.2 threadprivate Directive
 ! The threadprivate directive specifies that variables are replicated,

diff  --git a/flang/test/Semantics/omp-symbol06.f90 b/flang/test/Semantics/omp-symbol06.f90
index b8ac0fc06115..1a031a7a5a2a 100644
--- a/flang/test/Semantics/omp-symbol06.f90
+++ b/flang/test/Semantics/omp-symbol06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 2.15.3 Data-Sharing Attribute Clauses
 ! A list item that specifies a given variable may not appear in more than

diff  --git a/flang/test/Semantics/omp-symbol07.f90 b/flang/test/Semantics/omp-symbol07.f90
index c6cf500b41da..2098bd89bba5 100644
--- a/flang/test/Semantics/omp-symbol07.f90
+++ b/flang/test/Semantics/omp-symbol07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! Generic tests
 !   1. subroutine or function calls should not be fixed for DSA or DMA

diff  --git a/flang/test/Semantics/omp-symbol08.f90 b/flang/test/Semantics/omp-symbol08.f90
index 3a11933ac023..567c056b69e0 100644
--- a/flang/test/Semantics/omp-symbol08.f90
+++ b/flang/test/Semantics/omp-symbol08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
 
 ! 2.15.1.1 Predetermined rules for associated do-loops index variable
 !   a) The loop iteration variable(s) in the associated do-loop(s) of a do,

diff  --git a/flang/test/Semantics/procinterface01.f90 b/flang/test/Semantics/procinterface01.f90
index b66206e24134..a960922d5637 100644
--- a/flang/test/Semantics/procinterface01.f90
+++ b/flang/test/Semantics/procinterface01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Tests for "proc-interface" semantics.
 ! These cases are all valid.
 

diff  --git a/flang/test/Semantics/resolve01.f90 b/flang/test/Semantics/resolve01.f90
index f64599ec06a0..7373e414e286 100644
--- a/flang/test/Semantics/resolve01.f90
+++ b/flang/test/Semantics/resolve01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 integer :: x
 !ERROR: The type of 'x' has already been declared
 real :: x

diff  --git a/flang/test/Semantics/resolve02.f90 b/flang/test/Semantics/resolve02.f90
index 9978a95409e3..df5b6b5ba8c5 100644
--- a/flang/test/Semantics/resolve02.f90
+++ b/flang/test/Semantics/resolve02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s
   !ERROR: Declaration of 'x' conflicts with its use as internal procedure
   real :: x

diff  --git a/flang/test/Semantics/resolve03.f90 b/flang/test/Semantics/resolve03.f90
index 825509da84d7..4aca98575aad 100644
--- a/flang/test/Semantics/resolve03.f90
+++ b/flang/test/Semantics/resolve03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 implicit none
 integer :: x
 !ERROR: No explicit type declared for 'y'

diff  --git a/flang/test/Semantics/resolve04.f90 b/flang/test/Semantics/resolve04.f90
index eeb6cb686896..d0bad7e8800a 100644
--- a/flang/test/Semantics/resolve04.f90
+++ b/flang/test/Semantics/resolve04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 !ERROR: No explicit type declared for 'f'
 function f()
   implicit none

diff  --git a/flang/test/Semantics/resolve05.f90 b/flang/test/Semantics/resolve05.f90
index 89d501c664fd..7f365335e74d 100644
--- a/flang/test/Semantics/resolve05.f90
+++ b/flang/test/Semantics/resolve05.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 program p
   integer :: p ! this is ok
 end

diff  --git a/flang/test/Semantics/resolve06.f90 b/flang/test/Semantics/resolve06.f90
index c0fd7a1ae5d4..0ea1f7e80300 100644
--- a/flang/test/Semantics/resolve06.f90
+++ b/flang/test/Semantics/resolve06.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 implicit none
 allocatable :: x
 integer :: x

diff  --git a/flang/test/Semantics/resolve07.f90 b/flang/test/Semantics/resolve07.f90
index 08156c4343f8..68dd7d3b90ae 100644
--- a/flang/test/Semantics/resolve07.f90
+++ b/flang/test/Semantics/resolve07.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   integer :: x(2)
   !ERROR: The dimensions of 'x' have already been declared

diff  --git a/flang/test/Semantics/resolve08.f90 b/flang/test/Semantics/resolve08.f90
index db238a496133..7d978b9cc550 100644
--- a/flang/test/Semantics/resolve08.f90
+++ b/flang/test/Semantics/resolve08.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 integer :: g(10)
 f(i) = i + 1  ! statement function
 g(i) = i + 2  ! mis-parsed array assignment

diff  --git a/flang/test/Semantics/resolve09.f90 b/flang/test/Semantics/resolve09.f90
index cf9195992455..9b1173dd7c0a 100644
--- a/flang/test/Semantics/resolve09.f90
+++ b/flang/test/Semantics/resolve09.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 integer :: y
 procedure() :: a
 procedure(real) :: b

diff  --git a/flang/test/Semantics/resolve10.f90 b/flang/test/Semantics/resolve10.f90
index 5506d3916c76..570ea0002526 100644
--- a/flang/test/Semantics/resolve10.f90
+++ b/flang/test/Semantics/resolve10.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   public
   type t

diff  --git a/flang/test/Semantics/resolve11.f90 b/flang/test/Semantics/resolve11.f90
index 1ff6a63ebf07..60dfcb8a1024 100644
--- a/flang/test/Semantics/resolve11.f90
+++ b/flang/test/Semantics/resolve11.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   public i
   integer, private :: j

diff  --git a/flang/test/Semantics/resolve12.f90 b/flang/test/Semantics/resolve12.f90
index b68e3b76544f..967a0dcd8b37 100644
--- a/flang/test/Semantics/resolve12.f90
+++ b/flang/test/Semantics/resolve12.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
 end
 

diff  --git a/flang/test/Semantics/resolve13.f90 b/flang/test/Semantics/resolve13.f90
index 5ee05db5e782..a611aa09e5cc 100644
--- a/flang/test/Semantics/resolve13.f90
+++ b/flang/test/Semantics/resolve13.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
   integer :: x
   integer, private :: y

diff  --git a/flang/test/Semantics/resolve14.f90 b/flang/test/Semantics/resolve14.f90
index d24a5c621655..826e0da1c758 100644
--- a/flang/test/Semantics/resolve14.f90
+++ b/flang/test/Semantics/resolve14.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
   integer :: x
   integer :: y

diff  --git a/flang/test/Semantics/resolve15.f90 b/flang/test/Semantics/resolve15.f90
index d91713a2b91a..3658a68e1e88 100644
--- a/flang/test/Semantics/resolve15.f90
+++ b/flang/test/Semantics/resolve15.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   real :: var
   interface i

diff  --git a/flang/test/Semantics/resolve16.f90 b/flang/test/Semantics/resolve16.f90
index a9d0842db7be..6e8ab5b3862c 100644
--- a/flang/test/Semantics/resolve16.f90
+++ b/flang/test/Semantics/resolve16.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   interface
     subroutine sub0

diff  --git a/flang/test/Semantics/resolve17.f90 b/flang/test/Semantics/resolve17.f90
index 4d1afee86b1a..59fd43605d23 100644
--- a/flang/test/Semantics/resolve17.f90
+++ b/flang/test/Semantics/resolve17.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   integer :: foo
   !Note: PGI, Intel, and GNU allow this; NAG and Sun do not

diff  --git a/flang/test/Semantics/resolve18.f90 b/flang/test/Semantics/resolve18.f90
index 50246ea01dc7..94b217e248f0 100644
--- a/flang/test/Semantics/resolve18.f90
+++ b/flang/test/Semantics/resolve18.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
   implicit none
 contains

diff  --git a/flang/test/Semantics/resolve19.f90 b/flang/test/Semantics/resolve19.f90
index 3234f4ccc1f2..dd91e414661e 100644
--- a/flang/test/Semantics/resolve19.f90
+++ b/flang/test/Semantics/resolve19.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   interface a
     subroutine s(x)

diff  --git a/flang/test/Semantics/resolve20.f90 b/flang/test/Semantics/resolve20.f90
index b38b8e35a494..f9cfc7cb1006 100644
--- a/flang/test/Semantics/resolve20.f90
+++ b/flang/test/Semantics/resolve20.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   abstract interface
     subroutine foo

diff  --git a/flang/test/Semantics/resolve21.f90 b/flang/test/Semantics/resolve21.f90
index dfd87b348591..0b63f1698da9 100644
--- a/flang/test/Semantics/resolve21.f90
+++ b/flang/test/Semantics/resolve21.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   type :: t
     integer :: i

diff  --git a/flang/test/Semantics/resolve22.f90 b/flang/test/Semantics/resolve22.f90
index b9290cb9de23..33d5c9567143 100644
--- a/flang/test/Semantics/resolve22.f90
+++ b/flang/test/Semantics/resolve22.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   !OK: interface followed by type with same name
   interface t

diff  --git a/flang/test/Semantics/resolve23.f90 b/flang/test/Semantics/resolve23.f90
index ffd408f660dc..01178a1264e3 100644
--- a/flang/test/Semantics/resolve23.f90
+++ b/flang/test/Semantics/resolve23.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   type :: t
     real :: y

diff  --git a/flang/test/Semantics/resolve24.f90 b/flang/test/Semantics/resolve24.f90
index 5b4a1adb11ab..22fe6ae305ae 100644
--- a/flang/test/Semantics/resolve24.f90
+++ b/flang/test/Semantics/resolve24.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine test1
   !ERROR: Generic interface 'foo' has both a function and a subroutine
   interface foo

diff  --git a/flang/test/Semantics/resolve25.f90 b/flang/test/Semantics/resolve25.f90
index 780c07535bac..3264194993ea 100644
--- a/flang/test/Semantics/resolve25.f90
+++ b/flang/test/Semantics/resolve25.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   interface foo
     subroutine s1(x)

diff  --git a/flang/test/Semantics/resolve26.f90 b/flang/test/Semantics/resolve26.f90
index 65cfccf0f68b..daf5fbe15028 100644
--- a/flang/test/Semantics/resolve26.f90
+++ b/flang/test/Semantics/resolve26.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
   interface
     module subroutine s()

diff  --git a/flang/test/Semantics/resolve27.f90 b/flang/test/Semantics/resolve27.f90
index c8e3d82b094f..72d69189c7e3 100644
--- a/flang/test/Semantics/resolve27.f90
+++ b/flang/test/Semantics/resolve27.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   interface
     module subroutine s()

diff  --git a/flang/test/Semantics/resolve28.f90 b/flang/test/Semantics/resolve28.f90
index 17e603251518..c5c23a168e82 100644
--- a/flang/test/Semantics/resolve28.f90
+++ b/flang/test/Semantics/resolve28.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s
   type t
   end type

diff  --git a/flang/test/Semantics/resolve29.f90 b/flang/test/Semantics/resolve29.f90
index 7dcd61671e5c..d9ad4aa11b38 100644
--- a/flang/test/Semantics/resolve29.f90
+++ b/flang/test/Semantics/resolve29.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   type t1
   end type

diff  --git a/flang/test/Semantics/resolve30.f90 b/flang/test/Semantics/resolve30.f90
index c3abaf5fd1a6..1274e95b8b16 100644
--- a/flang/test/Semantics/resolve30.f90
+++ b/flang/test/Semantics/resolve30.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   integer x
   block

diff  --git a/flang/test/Semantics/resolve31.f90 b/flang/test/Semantics/resolve31.f90
index 14a7bc9c8a36..a668e6877a08 100644
--- a/flang/test/Semantics/resolve31.f90
+++ b/flang/test/Semantics/resolve31.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C735 If EXTENDS appears, SEQUENCE shall not appear.
 ! C738 The same private-or-sequence shall not appear more than once in a
 ! given derived-type-def .

diff  --git a/flang/test/Semantics/resolve32.f90 b/flang/test/Semantics/resolve32.f90
index 1b0140e285ed..d06eede6ced5 100644
--- a/flang/test/Semantics/resolve32.f90
+++ b/flang/test/Semantics/resolve32.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m2
   public s2, s4
   private s3

diff  --git a/flang/test/Semantics/resolve33.f90 b/flang/test/Semantics/resolve33.f90
index 7df5ba935ab0..6f4f7b066c3a 100644
--- a/flang/test/Semantics/resolve33.f90
+++ b/flang/test/Semantics/resolve33.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Derived type parameters
 ! C731 The same type-param-name shall not appear more than once in a given
 ! derived-type-stmt.

diff  --git a/flang/test/Semantics/resolve34.f90 b/flang/test/Semantics/resolve34.f90
index 39730cee62de..783336614069 100644
--- a/flang/test/Semantics/resolve34.f90
+++ b/flang/test/Semantics/resolve34.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Extended derived types
 
 module m1

diff  --git a/flang/test/Semantics/resolve35.f90 b/flang/test/Semantics/resolve35.f90
index d78c1cbd4b74..db66adbdea05 100644
--- a/flang/test/Semantics/resolve35.f90
+++ b/flang/test/Semantics/resolve35.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Construct names
 
 subroutine s1

diff  --git a/flang/test/Semantics/resolve36.f90 b/flang/test/Semantics/resolve36.f90
index 13f6a144db5c..8a66d718aa89 100644
--- a/flang/test/Semantics/resolve36.f90
+++ b/flang/test/Semantics/resolve36.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 ! C1568 The procedure-name shall have been declared to be a separate module
 ! procedure in the containing program unit or an ancestor of that program unit.

diff  --git a/flang/test/Semantics/resolve37.f90 b/flang/test/Semantics/resolve37.f90
index c56ac3719dd7..7b5a488462ff 100644
--- a/flang/test/Semantics/resolve37.f90
+++ b/flang/test/Semantics/resolve37.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C701 The type-param-value for a kind type parameter shall be a constant
 ! expression.  This constraint looks like a mistake in the standard.
 integer, parameter :: k = 8

diff  --git a/flang/test/Semantics/resolve38.f90 b/flang/test/Semantics/resolve38.f90
index 98ac17f2d366..a36ecce384b9 100644
--- a/flang/test/Semantics/resolve38.f90
+++ b/flang/test/Semantics/resolve38.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C772
 module m1
   type t1

diff  --git a/flang/test/Semantics/resolve39.f90 b/flang/test/Semantics/resolve39.f90
index b34bbeca84f2..47a019eb7e44 100644
--- a/flang/test/Semantics/resolve39.f90
+++ b/flang/test/Semantics/resolve39.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   implicit none
   real(8) :: x = 2.0

diff  --git a/flang/test/Semantics/resolve40.f90 b/flang/test/Semantics/resolve40.f90
index b4d8aa0d915a..05c70b92c561 100644
--- a/flang/test/Semantics/resolve40.f90
+++ b/flang/test/Semantics/resolve40.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   namelist /nl/x
   block

diff  --git a/flang/test/Semantics/resolve41.f90 b/flang/test/Semantics/resolve41.f90
index 40522d8f4b7b..61e935f5c31e 100644
--- a/flang/test/Semantics/resolve41.f90
+++ b/flang/test/Semantics/resolve41.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
   implicit none
   real, parameter :: a = 8.0

diff  --git a/flang/test/Semantics/resolve42.f90 b/flang/test/Semantics/resolve42.f90
index af5d6e5ee377..b0b092ae3429 100644
--- a/flang/test/Semantics/resolve42.f90
+++ b/flang/test/Semantics/resolve42.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1
   !ERROR: Array 'z' without ALLOCATABLE or POINTER attribute must have explicit shape
   common x, y(4), z(:)

diff  --git a/flang/test/Semantics/resolve43.f90 b/flang/test/Semantics/resolve43.f90
index 2ef585a60021..18b8fa6a48be 100644
--- a/flang/test/Semantics/resolve43.f90
+++ b/flang/test/Semantics/resolve43.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for structure constructors.
 ! Errors caught by expression resolution are tested elsewhere; these are the
 ! errors meant to be caught by name resolution, as well as acceptable use

diff  --git a/flang/test/Semantics/resolve44.f90 b/flang/test/Semantics/resolve44.f90
index 41ab06ffb6c6..3ad70d49c82a 100644
--- a/flang/test/Semantics/resolve44.f90
+++ b/flang/test/Semantics/resolve44.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for recursive use of derived types.
 ! C744 If neither the POINTER nor the ALLOCATABLE attribute is specified, the
 ! declaration-type-spec in the component-def-stmt shall specify an intrinsic

diff  --git a/flang/test/Semantics/resolve45.f90 b/flang/test/Semantics/resolve45.f90
index bb5eaf4a5317..8ab75595d405 100644
--- a/flang/test/Semantics/resolve45.f90
+++ b/flang/test/Semantics/resolve45.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 function f1(x, y)
   integer x
   !ERROR: SAVE attribute may not be applied to dummy argument 'x'

diff  --git a/flang/test/Semantics/resolve46.f90 b/flang/test/Semantics/resolve46.f90
index da31741163ab..03b43fa7b340 100644
--- a/flang/test/Semantics/resolve46.f90
+++ b/flang/test/Semantics/resolve46.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C1030 - pointers to intrinsic procedures
 program main
   intrinsic :: cos ! a specific & generic intrinsic name

diff  --git a/flang/test/Semantics/resolve47.f90 b/flang/test/Semantics/resolve47.f90
index 0f27ee4b5fa2..a469a971e3de 100644
--- a/flang/test/Semantics/resolve47.f90
+++ b/flang/test/Semantics/resolve47.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m1
   !ERROR: Logical constant '.true.' may not be used as a defined operator
   interface operator(.TRUE.)

diff  --git a/flang/test/Semantics/resolve48.f90 b/flang/test/Semantics/resolve48.f90
index 6651a72cfe84..78f8b3aceca1 100644
--- a/flang/test/Semantics/resolve48.f90
+++ b/flang/test/Semantics/resolve48.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test correct use-association of a derived type.
 module m1
   implicit none

diff  --git a/flang/test/Semantics/resolve49.f90 b/flang/test/Semantics/resolve49.f90
index 583399044977..893d13d1acd5 100644
--- a/flang/test/Semantics/resolve49.f90
+++ b/flang/test/Semantics/resolve49.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test section subscript
 program p1
   real :: a(10,10)

diff  --git a/flang/test/Semantics/resolve50.f90 b/flang/test/Semantics/resolve50.f90
index 8158ab6bd72a..3ba16fa4e406 100644
--- a/flang/test/Semantics/resolve50.f90
+++ b/flang/test/Semantics/resolve50.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test coarray association in CHANGE TEAM statement
 
 subroutine s1

diff  --git a/flang/test/Semantics/resolve51.f90 b/flang/test/Semantics/resolve51.f90
index d2942a8f345b..bf977765b17d 100644
--- a/flang/test/Semantics/resolve51.f90
+++ b/flang/test/Semantics/resolve51.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test SELECT TYPE errors: C1157
 
 subroutine s1()

diff  --git a/flang/test/Semantics/resolve52.f90 b/flang/test/Semantics/resolve52.f90
index 33eef54755af..6f684e845918 100644
--- a/flang/test/Semantics/resolve52.f90
+++ b/flang/test/Semantics/resolve52.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests for C760:
 ! The passed-object dummy argument shall be a scalar, nonpointer, nonallocatable
 ! dummy data object with the same declared type as the type being defined;

diff  --git a/flang/test/Semantics/resolve53.f90 b/flang/test/Semantics/resolve53.f90
index e501941f5a6f..69c13dbe52eb 100644
--- a/flang/test/Semantics/resolve53.f90
+++ b/flang/test/Semantics/resolve53.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! 15.4.3.4.5 Restrictions on generic declarations
 ! Specific procedures of generic interfaces must be distinguishable.
 

diff  --git a/flang/test/Semantics/resolve54.f90 b/flang/test/Semantics/resolve54.f90
index f8b80fc126e4..32c3826a112d 100644
--- a/flang/test/Semantics/resolve54.f90
+++ b/flang/test/Semantics/resolve54.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests based on examples in C.10.6
 
 ! C.10.6(10)

diff  --git a/flang/test/Semantics/resolve55.f90 b/flang/test/Semantics/resolve55.f90
index 422168be90a8..9e6126543004 100644
--- a/flang/test/Semantics/resolve55.f90
+++ b/flang/test/Semantics/resolve55.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests for C1128:
 ! A variable-name that appears in a LOCAL or LOCAL_INIT locality-spec shall not
 ! have the ALLOCATABLE; INTENT (IN); or OPTIONAL attribute; shall not be of

diff  --git a/flang/test/Semantics/resolve56.f90 b/flang/test/Semantics/resolve56.f90
index ef99f99ec620..9b4dc2f7b7b7 100644
--- a/flang/test/Semantics/resolve56.f90
+++ b/flang/test/Semantics/resolve56.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test that associations constructs can be correctly combined. The intrinsic
 ! functions are not what is tested here, they are only use to reveal the types
 ! of local variables.

diff  --git a/flang/test/Semantics/resolve57.f90 b/flang/test/Semantics/resolve57.f90
index 50843a1bbfbc..fb1541488c38 100644
--- a/flang/test/Semantics/resolve57.f90
+++ b/flang/test/Semantics/resolve57.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests for the last sentence of C1128:
 !A variable-name that is not permitted to appear in a variable definition
 !context shall not appear in a LOCAL or LOCAL_INIT locality-spec.

diff  --git a/flang/test/Semantics/resolve58.f90 b/flang/test/Semantics/resolve58.f90
index 15fe4675c17d..30257ae52c5b 100644
--- a/flang/test/Semantics/resolve58.f90
+++ b/flang/test/Semantics/resolve58.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1(x, y)
   !ERROR: Array pointer 'x' must have deferred shape or assumed rank
   real, pointer :: x(1:)  ! C832

diff  --git a/flang/test/Semantics/resolve59.f90 b/flang/test/Semantics/resolve59.f90
index 49e46a9c8c7d..4deead1ab977 100644
--- a/flang/test/Semantics/resolve59.f90
+++ b/flang/test/Semantics/resolve59.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Testing 15.6.2.2 point 4 (What function-name refers to depending on the
 ! presence of RESULT).
 

diff  --git a/flang/test/Semantics/resolve60.f90 b/flang/test/Semantics/resolve60.f90
index 811460e35975..ea475edae7f5 100644
--- a/flang/test/Semantics/resolve60.f90
+++ b/flang/test/Semantics/resolve60.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Testing 7.6 enum
 
   ! OK

diff  --git a/flang/test/Semantics/resolve61.f90 b/flang/test/Semantics/resolve61.f90
index fe2840c74921..fc27caa814f2 100644
--- a/flang/test/Semantics/resolve61.f90
+++ b/flang/test/Semantics/resolve61.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 program p1
   integer(8) :: a, b, c, d
   pointer(a, b)

diff  --git a/flang/test/Semantics/resolve62.f90 b/flang/test/Semantics/resolve62.f90
index 1ce28f3426cc..7ad7dffb5dfb 100644
--- a/flang/test/Semantics/resolve62.f90
+++ b/flang/test/Semantics/resolve62.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Resolve generic based on number of arguments
 subroutine s1
   interface f

diff  --git a/flang/test/Semantics/resolve63.f90 b/flang/test/Semantics/resolve63.f90
index 59091574d5d8..50e1fd0ebdbc 100644
--- a/flang/test/Semantics/resolve63.f90
+++ b/flang/test/Semantics/resolve63.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Invalid operand types when user-defined operator is available
 module m1
   type :: t

diff  --git a/flang/test/Semantics/resolve64.f90 b/flang/test/Semantics/resolve64.f90
index b0c2a608a4eb..765ea344ad11 100644
--- a/flang/test/Semantics/resolve64.f90
+++ b/flang/test/Semantics/resolve64.f90
@@ -1,5 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -flogical-abbreviations -fxor-operator
+! RUN: %S/test_errors.sh %s %t %f18 -flogical-abbreviations -fxor-operator
 
 ! Like m4 in resolve63 but compiled with 
diff erent options.
 ! Alternate operators are enabled so treat these as intrinsic.

diff  --git a/flang/test/Semantics/resolve65.f90 b/flang/test/Semantics/resolve65.f90
index f43d70bb22c7..e02a90c344cc 100644
--- a/flang/test/Semantics/resolve65.f90
+++ b/flang/test/Semantics/resolve65.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test restrictions on what subprograms can be used for defined assignment.
 
 module m1

diff  --git a/flang/test/Semantics/resolve66.f90 b/flang/test/Semantics/resolve66.f90
index 2f2e3595786c..33a027a5883e 100644
--- a/flang/test/Semantics/resolve66.f90
+++ b/flang/test/Semantics/resolve66.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test that user-defined assignment is used in the right places
 
 module m1

diff  --git a/flang/test/Semantics/resolve67.f90 b/flang/test/Semantics/resolve67.f90
index 883909e13936..08042a21f6d6 100644
--- a/flang/test/Semantics/resolve67.f90
+++ b/flang/test/Semantics/resolve67.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test restrictions on what subprograms can be used for defined operators.
 ! See: 15.4.3.4.2
 

diff  --git a/flang/test/Semantics/resolve68.f90 b/flang/test/Semantics/resolve68.f90
index caa6f2533f98..2a452a03ddf6 100644
--- a/flang/test/Semantics/resolve68.f90
+++ b/flang/test/Semantics/resolve68.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Test resolution of type-bound generics.
 
 module m1

diff  --git a/flang/test/Semantics/resolve69.f90 b/flang/test/Semantics/resolve69.f90
index d5a35aa00306..6fa6c65df809 100644
--- a/flang/test/Semantics/resolve69.f90
+++ b/flang/test/Semantics/resolve69.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 subroutine s1()
   ! C701 (R701) The type-param-value for a kind type parameter shall be a
   ! constant expression.

diff  --git a/flang/test/Semantics/resolve70.f90 b/flang/test/Semantics/resolve70.f90
index 8f805b6be72d..564805a12408 100644
--- a/flang/test/Semantics/resolve70.f90
+++ b/flang/test/Semantics/resolve70.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C703 (R702) The derived-type-spec shall not specify an abstract type (7.5.7).
 ! This constraint refers to the derived-type-spec in a type-spec.  A type-spec
 ! can appear in an ALLOCATE statement, an ac-spec for an array constructor, and

diff  --git a/flang/test/Semantics/resolve71.f90 b/flang/test/Semantics/resolve71.f90
index b4a232ebc2fa..8d204d399149 100644
--- a/flang/test/Semantics/resolve71.f90
+++ b/flang/test/Semantics/resolve71.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C708 An entity declared with the CLASS keyword shall be a dummy argument 
 ! or have the ALLOCATABLE or POINTER attribute.
 subroutine s()

diff  --git a/flang/test/Semantics/resolve72.f90 b/flang/test/Semantics/resolve72.f90
index 0e7dfcbfd762..516bd689e403 100644
--- a/flang/test/Semantics/resolve72.f90
+++ b/flang/test/Semantics/resolve72.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C709 An assumed-type entity shall be a dummy data object that does not have 
 ! the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE attribute and 
 ! is not an explicit-shape array.

diff  --git a/flang/test/Semantics/resolve73.f90 b/flang/test/Semantics/resolve73.f90
index 195f7027a2a4..5640c18fc86b 100644
--- a/flang/test/Semantics/resolve73.f90
+++ b/flang/test/Semantics/resolve73.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C721 A type-param-value of * shall be used only
 ! * to declare a dummy argument,
 ! * to declare a named constant,

diff  --git a/flang/test/Semantics/resolve74.f90 b/flang/test/Semantics/resolve74.f90
index 79a1b2cec49d..4c0ca0738e16 100644
--- a/flang/test/Semantics/resolve74.f90
+++ b/flang/test/Semantics/resolve74.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C722 A function name shall not be declared with an asterisk type-param-value 
 ! unless it is of type CHARACTER and is the name of a dummy function or the 
 ! name of the result of an external function.

diff  --git a/flang/test/Semantics/resolve75.f90 b/flang/test/Semantics/resolve75.f90
index 025159d78dd4..a9a8ca0f1121 100644
--- a/flang/test/Semantics/resolve75.f90
+++ b/flang/test/Semantics/resolve75.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C726 The length specified for a character statement function or for a 
 ! statement function dummy argument of type character shall be a constant 
 ! expression.

diff  --git a/flang/test/Semantics/resolve76.f90 b/flang/test/Semantics/resolve76.f90
index e5e22a99dd19..7d40184f3c52 100644
--- a/flang/test/Semantics/resolve76.f90
+++ b/flang/test/Semantics/resolve76.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 ! 15.6.2.5(3)
 

diff  --git a/flang/test/Semantics/resolve77.f90 b/flang/test/Semantics/resolve77.f90
index efd04d975c79..8b85db96be3d 100644
--- a/flang/test/Semantics/resolve77.f90
+++ b/flang/test/Semantics/resolve77.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Tests valid and invalid usage of forward references to procedures
 ! in specification expressions.
 module m

diff  --git a/flang/test/Semantics/resolve78.f90 b/flang/test/Semantics/resolve78.f90
index 280e1256dc55..92a6cf8361ae 100644
--- a/flang/test/Semantics/resolve78.f90
+++ b/flang/test/Semantics/resolve78.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
 ! C743 No component-attr-spec shall appear more than once in a 
 ! given component-def-stmt.

diff  --git a/flang/test/Semantics/resolve79.f90 b/flang/test/Semantics/resolve79.f90
index 3bac3bf30583..a010324dc23d 100644
--- a/flang/test/Semantics/resolve79.f90
+++ b/flang/test/Semantics/resolve79.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
 ! C755 The same proc-component-attr-spec shall not appear more than once in a 
 ! given proc-component-def-stmt.

diff  --git a/flang/test/Semantics/resolve80.f90 b/flang/test/Semantics/resolve80.f90
index 4a196e26fc76..7e9df344a161 100644
--- a/flang/test/Semantics/resolve80.f90
+++ b/flang/test/Semantics/resolve80.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
 !C778 The same binding-attr shall not appear more than once in a given
 !binding-attr-list.

diff  --git a/flang/test/Semantics/resolve81.f90 b/flang/test/Semantics/resolve81.f90
index 14f80ac9aaba..956d57f18d1c 100644
--- a/flang/test/Semantics/resolve81.f90
+++ b/flang/test/Semantics/resolve81.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C801 The same attr-spec shall not appear more than once in a given
 ! type-declaration-stmt.
 !

diff  --git a/flang/test/Semantics/resolve82.f90 b/flang/test/Semantics/resolve82.f90
index 673abaa765ed..10cde732546f 100644
--- a/flang/test/Semantics/resolve82.f90
+++ b/flang/test/Semantics/resolve82.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C815 An entity shall not be explicitly given any attribute more than once in 
 ! a scoping unit.
 !

diff  --git a/flang/test/Semantics/resolve83.f90 b/flang/test/Semantics/resolve83.f90
index c7a4502fd6f5..94f36a13b5dc 100644
--- a/flang/test/Semantics/resolve83.f90
+++ b/flang/test/Semantics/resolve83.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
 
   ! For C1543

diff  --git a/flang/test/Semantics/resolve84.f90 b/flang/test/Semantics/resolve84.f90
index 06afdfc492e1..89b8f2e815ec 100644
--- a/flang/test/Semantics/resolve84.f90
+++ b/flang/test/Semantics/resolve84.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C729 A derived type type-name shall not be DOUBLEPRECISION or the same as 
 ! the name of any intrinsic type defined in this document.
 subroutine s()

diff  --git a/flang/test/Semantics/resolve85.f90 b/flang/test/Semantics/resolve85.f90
index 99391a364598..44e6519779c0 100644
--- a/flang/test/Semantics/resolve85.f90
+++ b/flang/test/Semantics/resolve85.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 module m
 ! C730 The same type-attr-spec shall not appear more than once in a given 
 ! derived-type-stmt.

diff  --git a/flang/test/Semantics/resolve86.f90 b/flang/test/Semantics/resolve86.f90
index 0c42bcea0a42..4885e63a1c0e 100644
--- a/flang/test/Semantics/resolve86.f90
+++ b/flang/test/Semantics/resolve86.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C736 If EXTENDS appears and the type being defined has a coarray ultimate 
 ! component, its parent type shall have a coarray ultimate component.
 !

diff  --git a/flang/test/Semantics/resolve87.f90 b/flang/test/Semantics/resolve87.f90
index ad09d8155ec6..f2f098bfae37 100644
--- a/flang/test/Semantics/resolve87.f90
+++ b/flang/test/Semantics/resolve87.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C737 If EXTENDS appears and the type being defined has a potential 
 ! subobject component of type EVENT_TYPE or LOCK_TYPE from the intrinsic 
 ! module ISO_FORTRAN_ENV, its parent type shall be EVENT_TYPE or LOCK_TYPE 

diff  --git a/flang/test/Semantics/resolve88.f90 b/flang/test/Semantics/resolve88.f90
index 50135297241c..19217e69be27 100644
--- a/flang/test/Semantics/resolve88.f90
+++ b/flang/test/Semantics/resolve88.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C746, C747, and C748
 module m
   use ISO_FORTRAN_ENV

diff  --git a/flang/test/Semantics/resolve89.f90 b/flang/test/Semantics/resolve89.f90
index 93fc82c60310..fd9488ff0b01 100644
--- a/flang/test/Semantics/resolve89.f90
+++ b/flang/test/Semantics/resolve89.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! C750 Each bound in the explicit-shape-spec shall be a specification
 ! expression in which there are no references to specification functions or
 ! the intrinsic functions ALLOCATED, ASSOCIATED, EXTENDS_- TYPE_OF, PRESENT,

diff  --git a/flang/test/Semantics/select-rank.f90 b/flang/test/Semantics/select-rank.f90
index 71fc9d85f185..2478f804bc11 100644
--- a/flang/test/Semantics/select-rank.f90
+++ b/flang/test/Semantics/select-rank.f90
@@ -1,4 +1,5 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
+
 !Tests for SELECT RANK Construct(R1148)
 program select_rank
    implicit none

diff  --git a/flang/test/Semantics/select-rank02.f90 b/flang/test/Semantics/select-rank02.f90
index 00331f4b9822..51c4f66b2ed3 100644
--- a/flang/test/Semantics/select-rank02.f90
+++ b/flang/test/Semantics/select-rank02.f90
@@ -1,4 +1,5 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
+
 !Shape analysis related tests for SELECT RANK Construct(R1148)
 program select_rank
    implicit none

diff  --git a/flang/test/Semantics/separate-mp01.f90 b/flang/test/Semantics/separate-mp01.f90
index b34b3500e28f..0dc4991a93c6 100644
--- a/flang/test/Semantics/separate-mp01.f90
+++ b/flang/test/Semantics/separate-mp01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 ! case 1: ma_create_new_fun' was not declared a separate module procedure
 module m1

diff  --git a/flang/test/Semantics/separate-mp02.f90 b/flang/test/Semantics/separate-mp02.f90
index 823bfaca1413..47abc83bff1e 100644
--- a/flang/test/Semantics/separate-mp02.f90
+++ b/flang/test/Semantics/separate-mp02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 
 ! When a module subprogram has the MODULE prefix the following must match
 ! with the corresponding separate module procedure interface body:

diff  --git a/flang/test/Semantics/stop01.f90 b/flang/test/Semantics/stop01.f90
index 69c5ad83e481..0563eea02a68 100644
--- a/flang/test/Semantics/stop01.f90
+++ b/flang/test/Semantics/stop01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 program main
   implicit none
   integer :: i = -1

diff  --git a/flang/test/Semantics/structconst01.f90 b/flang/test/Semantics/structconst01.f90
index cdd2e77a506a..dd2ae3441d86 100644
--- a/flang/test/Semantics/structconst01.f90
+++ b/flang/test/Semantics/structconst01.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for structure constructors.
 ! Errors caught by name resolution are tested elsewhere; these are the
 ! errors meant to be caught by expression semantic analysis, as well as

diff  --git a/flang/test/Semantics/structconst02.f90 b/flang/test/Semantics/structconst02.f90
index a309b02e8fe0..f8a303dc79c2 100644
--- a/flang/test/Semantics/structconst02.f90
+++ b/flang/test/Semantics/structconst02.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for structure constructors: per-component type
 ! (in)compatibility.
 

diff  --git a/flang/test/Semantics/structconst03.f90 b/flang/test/Semantics/structconst03.f90
index 01d40720e771..dbf53e11c619 100644
--- a/flang/test/Semantics/structconst03.f90
+++ b/flang/test/Semantics/structconst03.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for structure constructors: C1594 violations
 ! from assigning globally-visible data to POINTER components.
 ! test/Semantics/structconst04.f90 is this same test without type

diff  --git a/flang/test/Semantics/structconst04.f90 b/flang/test/Semantics/structconst04.f90
index 3f0b21c6d5ec..c5bc2d3e6bf3 100644
--- a/flang/test/Semantics/structconst04.f90
+++ b/flang/test/Semantics/structconst04.f90
@@ -1,4 +1,4 @@
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
 ! Error tests for structure constructors: C1594 violations
 ! from assigning globally-visible data to POINTER components.
 ! This test is structconst03.f90 with the type parameters removed.

diff  --git a/flang/test/Semantics/symbol01.f90 b/flang/test/Semantics/symbol01.f90
index 9d8cacd3d6b8..4dc2cb790413 100644
--- a/flang/test/Semantics/symbol01.f90
+++ b/flang/test/Semantics/symbol01.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Test that intent-stmt and subprogram prefix and suffix are resolved.
 
 !DEF: /m Module

diff  --git a/flang/test/Semantics/symbol02.f90 b/flang/test/Semantics/symbol02.f90
index 8f53c50580ed..4d73edd66044 100644
--- a/flang/test/Semantics/symbol02.f90
+++ b/flang/test/Semantics/symbol02.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Test host association in module subroutine and internal subroutine.
 
 !DEF: /m Module

diff  --git a/flang/test/Semantics/symbol03.f90 b/flang/test/Semantics/symbol03.f90
index 41a7cc26e694..2f3620284a83 100644
--- a/flang/test/Semantics/symbol03.f90
+++ b/flang/test/Semantics/symbol03.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Test host association in internal subroutine of main program.
 
 !DEF: /main MainProgram

diff  --git a/flang/test/Semantics/symbol05.f90 b/flang/test/Semantics/symbol05.f90
index 678b8f19f55d..0c36384a6c4e 100644
--- a/flang/test/Semantics/symbol05.f90
+++ b/flang/test/Semantics/symbol05.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Explicit and implicit entities in blocks
 
 !DEF: /s1 (Subroutine) Subprogram

diff  --git a/flang/test/Semantics/symbol06.f90 b/flang/test/Semantics/symbol06.f90
index b3b3e17b10da..553cb14af422 100644
--- a/flang/test/Semantics/symbol06.f90
+++ b/flang/test/Semantics/symbol06.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /main MainProgram
 program main
  !DEF: /main/t1 DerivedType

diff  --git a/flang/test/Semantics/symbol07.f90 b/flang/test/Semantics/symbol07.f90
index b387ec6c673b..f0bc0e47eee2 100644
--- a/flang/test/Semantics/symbol07.f90
+++ b/flang/test/Semantics/symbol07.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /main MainProgram
 program main
  implicit complex(z)

diff  --git a/flang/test/Semantics/symbol08.f90 b/flang/test/Semantics/symbol08.f90
index 801f7f449b20..711a9f694c8e 100644
--- a/flang/test/Semantics/symbol08.f90
+++ b/flang/test/Semantics/symbol08.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /main MainProgram
 program main
  !DEF: /main/x POINTER ObjectEntity REAL(4)

diff  --git a/flang/test/Semantics/symbol09.f90 b/flang/test/Semantics/symbol09.f90
index 77d4a3416df3..45cb59db28a3 100644
--- a/flang/test/Semantics/symbol09.f90
+++ b/flang/test/Semantics/symbol09.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /s1 (Subroutine) Subprogram
 subroutine s1
  !DEF: /s1/a ObjectEntity REAL(4)

diff  --git a/flang/test/Semantics/symbol10.f90 b/flang/test/Semantics/symbol10.f90
index e487764fa5a2..60da43a97f74 100644
--- a/flang/test/Semantics/symbol10.f90
+++ b/flang/test/Semantics/symbol10.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /m1 Module
 module m1
 contains

diff  --git a/flang/test/Semantics/symbol11.f90 b/flang/test/Semantics/symbol11.f90
index e759310c8dcb..e6ae26c740e5 100644
--- a/flang/test/Semantics/symbol11.f90
+++ b/flang/test/Semantics/symbol11.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 !DEF: /s1 (Subroutine) Subprogram
 subroutine s1
  implicit none

diff  --git a/flang/test/Semantics/symbol12.f90 b/flang/test/Semantics/symbol12.f90
index 22350f6c25e2..339f1707a584 100644
--- a/flang/test/Semantics/symbol12.f90
+++ b/flang/test/Semantics/symbol12.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Verify that SAVE attribute is propagated by EQUIVALENCE
 
 !DEF: /s1 (Subroutine) Subprogram

diff  --git a/flang/test/Semantics/symbol13.f90 b/flang/test/Semantics/symbol13.f90
index 640066ed76ea..47ea86b4b34a 100644
--- a/flang/test/Semantics/symbol13.f90
+++ b/flang/test/Semantics/symbol13.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Old-style "*length" specifiers (R723)
 
 !DEF: /f1 (Function) Subprogram CHARACTER(1_8,1)

diff  --git a/flang/test/Semantics/symbol14.f90 b/flang/test/Semantics/symbol14.f90
index d523e8d6f480..5d1af5e6ed8c 100644
--- a/flang/test/Semantics/symbol14.f90
+++ b/flang/test/Semantics/symbol14.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! "Bare" uses of type parameters and components
 
  !DEF: /MainProgram1/t1 DerivedType

diff  --git a/flang/test/Semantics/symbol15.f90 b/flang/test/Semantics/symbol15.f90
index 00298cfa1d84..079dceca3c90 100644
--- a/flang/test/Semantics/symbol15.f90
+++ b/flang/test/Semantics/symbol15.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Forward references in pointer initializers and TBP bindings.
 
 !DEF: /m Module

diff  --git a/flang/test/Semantics/symbol16.f90 b/flang/test/Semantics/symbol16.f90
index 0650222e0833..ce47134fc337 100644
--- a/flang/test/Semantics/symbol16.f90
+++ b/flang/test/Semantics/symbol16.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Statement functions
 
 !DEF: /p1 MainProgram

diff  --git a/flang/test/Semantics/symbol17.f90 b/flang/test/Semantics/symbol17.f90
index a99c8245f6d7..1994cf9977da 100644
--- a/flang/test/Semantics/symbol17.f90
+++ b/flang/test/Semantics/symbol17.f90
@@ -1,4 +1,4 @@
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
 ! Forward references to derived types (non-error cases)
 
 !DEF: /main MainProgram

diff  --git a/flang/test/Semantics/test_any.sh b/flang/test/Semantics/test_any.sh
index 19fa22f1574d..3ad960de323a 100755
--- a/flang/test/Semantics/test_any.sh
+++ b/flang/test/Semantics/test_any.sh
@@ -48,7 +48,7 @@ function internal_check() {
 }
 
 gr=0
-for input in $1; do
+for input in $src; do
   [[ ! -f $input ]] && die "File not found: $input"
   CMD=$(cat ${input} | egrep '^[[:space:]]*![[:space:]]*EXEC:[[:space:]]*' | sed -e 's/^[[:space:]]*![[:space:]]*EXEC:[[:space:]]*//')
   CMD=$(echo ${CMD} | sed -e "s:%s:${input}:g")

diff  --git a/flang/test/Semantics/test_errors.sh.in b/flang/test/Semantics/test_errors.sh
similarity index 88%
rename from flang/test/Semantics/test_errors.sh.in
rename to flang/test/Semantics/test_errors.sh
index 535ded3882bf..15383475c505 100755
--- a/flang/test/Semantics/test_errors.sh.in
+++ b/flang/test/Semantics/test_errors.sh
@@ -3,7 +3,7 @@
 # Change the compiler by setting the F18 environment variable.
 
 F18_OPTIONS="-fdebug-resolve-names -fparse-only"
-srcdir="@CMAKE_CURRENT_SOURCE_DIR@"
+srcdir=$(dirname $0)
 source $srcdir/common.sh
 [[ ! -f $src ]] && die "File not found: $src"
 
@@ -12,8 +12,7 @@ actual=$temp/actual
 expect=$temp/expect
 
diff s=$temp/
diff s
 
-include="@FLANG_INTRINSIC_MODULES_DIR@"
-cmd="$F18 $F18_OPTIONS $USER_OPTIONS -I$include $src"
+cmd="$F18 $F18_OPTIONS $src"
 ( cd $temp; $cmd ) > $log 2>&1
 if [[ $? -ge 128 ]]; then
   cat $log

diff  --git a/flang/test/Semantics/test_modfile.sh b/flang/test/Semantics/test_modfile.sh
index 8e8cdd0df5c6..9205451c176d 100755
--- a/flang/test/Semantics/test_modfile.sh
+++ b/flang/test/Semantics/test_modfile.sh
@@ -21,7 +21,7 @@ for src in "$@"; do
   (
     cd $temp
     ls -1 *.mod > prev_files
-    $F18 $F18_OPTIONS $USER_OPTIONS $src
+    $F18 $F18_OPTIONS $src
     ls -1 *.mod | comm -13 prev_files -
   ) > $actual_files
   expected_files=$(sed -n 's/^!Expect: \(.*\)/\1/p' $src | sort)

diff  --git a/flang/test/Semantics/test_symbols.sh b/flang/test/Semantics/test_symbols.sh
index 22c592cf16c4..d2b3d688a39b 100755
--- a/flang/test/Semantics/test_symbols.sh
+++ b/flang/test/Semantics/test_symbols.sh
@@ -21,7 +21,7 @@ sed -e 's/!\([DR]EF:\)/KEEP \1/' -e 's/!\($omp\)/KEEP \1/' \
   $src > $src1
 egrep -v '![DR]EF:' $src1 > $src2  # strip out DEF and REF comments
 # compile, inserting comments for symbols:
-( cd $temp; $F18 $F18_OPTIONS $USER_OPTIONS $(basename $src2) ) > $src3
+( cd $temp; $F18 $F18_OPTIONS $(basename $src2) ) > $src3
 
 if 
diff  -w -U999999 $src1 $src3 > $
diff s; then
   echo PASS

diff  --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index c1aa851097b7..8ad5a9b6357f 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -54,15 +54,12 @@
   if config.llvm_tools_dir != config.flang_llvm_tools_dir :
     llvm_config.with_environment('PATH', config.flang_llvm_tools_dir, append_path=True)
 
-config.substitutions.append(('%B', config.flang_obj_root))
-
 # For each occurrence of a flang tool name, replace it with the full path to
 # the build directory holding that tool.
 tools = [
-  ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'),
-  ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'),
-  ToolSubst('%f18_with_includes', command=FindTool('f18'),
-    extra_args=["-I" + config.flang_intrinsic_modules_dir], unresolved='fatal')
+  ToolSubst('%f18', command=FindTool('f18'),
+    extra_args=["-intrinsic-module-directory "+config.flang_intrinsic_modules_dir],
+    unresolved='fatal')
 ]
 llvm_config.add_tool_substitutions(tools, [config.flang_llvm_tools_dir])
 


        


More information about the flang-commits mailing list