[flang-commits] [flang] 6c1ac14 - [Flang] Ported test_errors.sh to Python

Ivan Zhechev via flang-commits flang-commits at lists.llvm.org
Mon Sep 6 01:19:53 PDT 2021


Author: Ivan Zhechev
Date: 2021-09-06T08:19:42Z
New Revision: 6c1ac141d3c98af9738bc77fcb55602cbff7751f

URL: https://github.com/llvm/llvm-project/commit/6c1ac141d3c98af9738bc77fcb55602cbff7751f
DIFF: https://github.com/llvm/llvm-project/commit/6c1ac141d3c98af9738bc77fcb55602cbff7751f.diff

LOG: [Flang] Ported test_errors.sh to Python

To enable Flang testing on Windows, shell scripts have to be ported to Python. In this patch the "test_errors.sh" script is ported to python ("test_errors.py"). The RUN line of existing tests was changed to make use of the python script.

Used python regex in place of awk/sed.

Reviewed By: Meinersbur

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

Added: 
    flang/test/Semantics/test_errors.py

Modified: 
    flang/test/Semantics/OpenACC/acc-atomic-validity.f90
    flang/test/Semantics/OpenACC/acc-branch.f90
    flang/test/Semantics/OpenACC/acc-cache-validity.f90
    flang/test/Semantics/OpenACC/acc-canonicalization-validity.f90
    flang/test/Semantics/OpenACC/acc-data.f90
    flang/test/Semantics/OpenACC/acc-declare-validity.f90
    flang/test/Semantics/OpenACC/acc-host-data.f90
    flang/test/Semantics/OpenACC/acc-init-validity.f90
    flang/test/Semantics/OpenACC/acc-kernels-loop.f90
    flang/test/Semantics/OpenACC/acc-kernels.f90
    flang/test/Semantics/OpenACC/acc-loop.f90
    flang/test/Semantics/OpenACC/acc-parallel-loop-validity.f90
    flang/test/Semantics/OpenACC/acc-parallel.f90
    flang/test/Semantics/OpenACC/acc-resolve01.f90
    flang/test/Semantics/OpenACC/acc-resolve02.f90
    flang/test/Semantics/OpenACC/acc-routine-validity.f90
    flang/test/Semantics/OpenACC/acc-serial-loop.f90
    flang/test/Semantics/OpenACC/acc-serial.f90
    flang/test/Semantics/OpenACC/acc-set-validity.f90
    flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
    flang/test/Semantics/OpenACC/acc-update-validity.f90
    flang/test/Semantics/OpenACC/acc-wait-validity.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/altreturn06.f90
    flang/test/Semantics/array-constr-big.f90
    flang/test/Semantics/array-constr-values.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/associated.f90
    flang/test/Semantics/bad-forward-type.f90
    flang/test/Semantics/bind-c01.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/boz-literal-constants.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/call16.f90
    flang/test/Semantics/call18.f90
    flang/test/Semantics/call19.f90
    flang/test/Semantics/call20.f90
    flang/test/Semantics/case01.f90
    flang/test/Semantics/coarrays01.f90
    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/data01.f90
    flang/test/Semantics/data02.f90
    flang/test/Semantics/data03.f90
    flang/test/Semantics/data04.f90
    flang/test/Semantics/data06.f90
    flang/test/Semantics/data07.f90
    flang/test/Semantics/data10.f90
    flang/test/Semantics/data12.f90
    flang/test/Semantics/deallocate01.f90
    flang/test/Semantics/deallocate04.f90
    flang/test/Semantics/deallocate05.f90
    flang/test/Semantics/deallocate06.f90
    flang/test/Semantics/doconcurrent01.f90
    flang/test/Semantics/doconcurrent05.f90
    flang/test/Semantics/doconcurrent06.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/expr-errors03.f90
    flang/test/Semantics/final01.f90
    flang/test/Semantics/forall01.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/implicit09.f90
    flang/test/Semantics/implicit10.f90
    flang/test/Semantics/implicit11.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/io11.f90
    flang/test/Semantics/kinds02.f90
    flang/test/Semantics/kinds04.f90
    flang/test/Semantics/label11.f90
    flang/test/Semantics/label16.f90
    flang/test/Semantics/misc-declarations.f90
    flang/test/Semantics/modfile41.f90
    flang/test/Semantics/namelist01.f90
    flang/test/Semantics/null-init.f90
    flang/test/Semantics/null01.f90
    flang/test/Semantics/nullify01.f90
    flang/test/Semantics/nullify02.f90
    flang/test/Semantics/num_images.f90
    flang/test/Semantics/omp-allocate-directive.f90
    flang/test/Semantics/omp-allocate01.f90
    flang/test/Semantics/omp-allocate02.f90
    flang/test/Semantics/omp-allocate03.f90
    flang/test/Semantics/omp-allocate04.f90
    flang/test/Semantics/omp-allocate05.f90
    flang/test/Semantics/omp-allocate06.f90
    flang/test/Semantics/omp-allocate07.f90
    flang/test/Semantics/omp-allocate08.f90
    flang/test/Semantics/omp-atomic.f90
    flang/test/Semantics/omp-atomic01.f90
    flang/test/Semantics/omp-clause-validity01.f90
    flang/test/Semantics/omp-combined-constructs.f90
    flang/test/Semantics/omp-copyin01.f90
    flang/test/Semantics/omp-copyin02.f90
    flang/test/Semantics/omp-copyin03.f90
    flang/test/Semantics/omp-copyin04.f90
    flang/test/Semantics/omp-copyin05.f90
    flang/test/Semantics/omp-copyprivate01.f90
    flang/test/Semantics/omp-copyprivate02.f90
    flang/test/Semantics/omp-copyprivate03.f90
    flang/test/Semantics/omp-declarative-directive.f90
    flang/test/Semantics/omp-default.f90
    flang/test/Semantics/omp-default02.f90
    flang/test/Semantics/omp-depend01.f90
    flang/test/Semantics/omp-depend02.f90
    flang/test/Semantics/omp-depend03.f90
    flang/test/Semantics/omp-device-constructs.f90
    flang/test/Semantics/omp-do-collapse-positivecases.f90
    flang/test/Semantics/omp-do-collapse.f90
    flang/test/Semantics/omp-do-cycle.f90
    flang/test/Semantics/omp-do-ordered-positivecases.f90
    flang/test/Semantics/omp-do-ordered.f90
    flang/test/Semantics/omp-do-schedule01.f90
    flang/test/Semantics/omp-do-schedule02.f90
    flang/test/Semantics/omp-do01.f90
    flang/test/Semantics/omp-do03.f90
    flang/test/Semantics/omp-do04.f90
    flang/test/Semantics/omp-do05.f90
    flang/test/Semantics/omp-do06.f90
    flang/test/Semantics/omp-do08.f90
    flang/test/Semantics/omp-do09.f90
    flang/test/Semantics/omp-do10.f90
    flang/test/Semantics/omp-do13.f90
    flang/test/Semantics/omp-do15.f90
    flang/test/Semantics/omp-do16.f90
    flang/test/Semantics/omp-firstprivate01.f90
    flang/test/Semantics/omp-flush01.f90
    flang/test/Semantics/omp-flush02.f90
    flang/test/Semantics/omp-lastprivate01.f90
    flang/test/Semantics/omp-lastprivate02.f90
    flang/test/Semantics/omp-linear-iter.f90
    flang/test/Semantics/omp-loop-association.f90
    flang/test/Semantics/omp-loop-simd01.f90
    flang/test/Semantics/omp-nested-barrier.f90
    flang/test/Semantics/omp-nested-cancel.f90
    flang/test/Semantics/omp-nested-cancellation-point.f90
    flang/test/Semantics/omp-nested-distribute.f90
    flang/test/Semantics/omp-nested-master.f90
    flang/test/Semantics/omp-nested-simd.f90
    flang/test/Semantics/omp-nested-target.f90
    flang/test/Semantics/omp-nested-teams.f90
    flang/test/Semantics/omp-nested01.f90
    flang/test/Semantics/omp-no-dowhile-in-parallel.f90
    flang/test/Semantics/omp-ordered-simd.f90
    flang/test/Semantics/omp-parallel-private01.f90
    flang/test/Semantics/omp-parallel-private02.f90
    flang/test/Semantics/omp-parallel-private03.f90
    flang/test/Semantics/omp-parallel-private04.f90
    flang/test/Semantics/omp-parallel-shared01.f90
    flang/test/Semantics/omp-parallel-shared02.f90
    flang/test/Semantics/omp-parallel-shared03.f90
    flang/test/Semantics/omp-parallel-shared04.f90
    flang/test/Semantics/omp-private01.f90
    flang/test/Semantics/omp-private02.f90
    flang/test/Semantics/omp-private03.f90
    flang/test/Semantics/omp-reduction01.f90
    flang/test/Semantics/omp-reduction02.f90
    flang/test/Semantics/omp-reduction03.f90
    flang/test/Semantics/omp-reduction04.f90
    flang/test/Semantics/omp-reduction05.f90
    flang/test/Semantics/omp-reduction06.f90
    flang/test/Semantics/omp-reduction07.f90
    flang/test/Semantics/omp-reduction10.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-resolve06.f90
    flang/test/Semantics/omp-sections01.f90
    flang/test/Semantics/omp-simd-aligned.f90
    flang/test/Semantics/omp-simd02.f90
    flang/test/Semantics/omp-single01.f90
    flang/test/Semantics/omp-single02.f90
    flang/test/Semantics/omp-taskgroup01.f90
    flang/test/Semantics/omp-taskloop-simd01.f90
    flang/test/Semantics/omp-taskloop01.f90
    flang/test/Semantics/omp-workshare01.f90
    flang/test/Semantics/omp-workshare02.f90
    flang/test/Semantics/omp-workshare03.f90
    flang/test/Semantics/omp-workshare04.f90
    flang/test/Semantics/omp-workshare05.f90
    flang/test/Semantics/random-seed.f90
    flang/test/Semantics/reshape.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/resolve101.f90
    flang/test/Semantics/resolve102.f90
    flang/test/Semantics/resolve104.f90
    flang/test/Semantics/resolve105.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/resolve90.f90
    flang/test/Semantics/resolve91.f90
    flang/test/Semantics/resolve92.f90
    flang/test/Semantics/resolve93.f90
    flang/test/Semantics/resolve94.f90
    flang/test/Semantics/resolve95.f90
    flang/test/Semantics/resolve96.f90
    flang/test/Semantics/resolve97.f90
    flang/test/Semantics/resolve98.f90
    flang/test/Semantics/resolve99.f90
    flang/test/Semantics/save01.f90
    flang/test/Semantics/select-rank.f90
    flang/test/Semantics/select-rank02.f90
    flang/test/Semantics/selecttype01.f90
    flang/test/Semantics/selecttype02.f90
    flang/test/Semantics/selecttype03.f90
    flang/test/Semantics/separate-mp01.f90
    flang/test/Semantics/separate-mp02.f90
    flang/test/Semantics/shape.f90
    flang/test/Semantics/spec-expr.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/unpack.f90

Removed: 
    flang/test/Semantics/test_errors.sh


################################################################################
diff  --git a/flang/test/Semantics/OpenACC/acc-atomic-validity.f90 b/flang/test/Semantics/OpenACC/acc-atomic-validity.f90
index 8ebac44bcca37..e6d82a77f6c1b 100644
--- a/flang/test/Semantics/OpenACC/acc-atomic-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-atomic-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.12 Atomic

diff  --git a/flang/test/Semantics/OpenACC/acc-branch.f90 b/flang/test/Semantics/OpenACC/acc-branch.f90
index b9ca12b0e8923..06c3b4da92921 100644
--- a/flang/test/Semantics/OpenACC/acc-branch.f90
+++ b/flang/test/Semantics/OpenACC/acc-branch.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC restruction in branch in and out of some construct
 !

diff  --git a/flang/test/Semantics/OpenACC/acc-cache-validity.f90 b/flang/test/Semantics/OpenACC/acc-cache-validity.f90
index 30c68ef3e1795..9afdd6def21fd 100644
--- a/flang/test/Semantics/OpenACC/acc-cache-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-cache-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.10 Cache

diff  --git a/flang/test/Semantics/OpenACC/acc-canonicalization-validity.f90 b/flang/test/Semantics/OpenACC/acc-canonicalization-validity.f90
index bc20aedd9b9f7..ad179d3b5f494 100644
--- a/flang/test/Semantics/OpenACC/acc-canonicalization-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-canonicalization-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC canonalization validity for the construct defined below:
 !   2.9 Loop

diff  --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90
index 6aa99e71e0bb9..24c67ee33494c 100644
--- a/flang/test/Semantics/OpenACC/acc-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-data.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.6.5 Data

diff  --git a/flang/test/Semantics/OpenACC/acc-declare-validity.f90 b/flang/test/Semantics/OpenACC/acc-declare-validity.f90
index fea97ecfe765d..5578d9afbc0d2 100644
--- a/flang/test/Semantics/OpenACC/acc-declare-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-declare-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.13 Declare

diff  --git a/flang/test/Semantics/OpenACC/acc-host-data.f90 b/flang/test/Semantics/OpenACC/acc-host-data.f90
index 877f0021cc5f3..4e9167722a228 100644
--- a/flang/test/Semantics/OpenACC/acc-host-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-host-data.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.8 host_data

diff  --git a/flang/test/Semantics/OpenACC/acc-init-validity.f90 b/flang/test/Semantics/OpenACC/acc-init-validity.f90
index 2b2eac51535d2..278211492c583 100644
--- a/flang/test/Semantics/OpenACC/acc-init-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-init-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.14.1 Init

diff  --git a/flang/test/Semantics/OpenACC/acc-kernels-loop.f90 b/flang/test/Semantics/OpenACC/acc-kernels-loop.f90
index 5b3b9c205229b..d84e1c2dedf40 100644
--- a/flang/test/Semantics/OpenACC/acc-kernels-loop.f90
+++ b/flang/test/Semantics/OpenACC/acc-kernels-loop.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.11 Kernels Loop

diff  --git a/flang/test/Semantics/OpenACC/acc-kernels.f90 b/flang/test/Semantics/OpenACC/acc-kernels.f90
index ccb128a0c9107..a2c9c9e8be99b 100644
--- a/flang/test/Semantics/OpenACC/acc-kernels.f90
+++ b/flang/test/Semantics/OpenACC/acc-kernels.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.5.3 Kernels

diff  --git a/flang/test/Semantics/OpenACC/acc-loop.f90 b/flang/test/Semantics/OpenACC/acc-loop.f90
index 2cd71751beac8..75e09958909cd 100644
--- a/flang/test/Semantics/OpenACC/acc-loop.f90
+++ b/flang/test/Semantics/OpenACC/acc-loop.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.9 Loop

diff  --git a/flang/test/Semantics/OpenACC/acc-parallel-loop-validity.f90 b/flang/test/Semantics/OpenACC/acc-parallel-loop-validity.f90
index 3dee14733b66e..312baacbc00a8 100644
--- a/flang/test/Semantics/OpenACC/acc-parallel-loop-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-parallel-loop-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.11 Parallel Loop

diff  --git a/flang/test/Semantics/OpenACC/acc-parallel.f90 b/flang/test/Semantics/OpenACC/acc-parallel.f90
index 75fb14fccc229..758e1a53c0d57 100644
--- a/flang/test/Semantics/OpenACC/acc-parallel.f90
+++ b/flang/test/Semantics/OpenACC/acc-parallel.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.5.1 Parallel

diff  --git a/flang/test/Semantics/OpenACC/acc-resolve01.f90 b/flang/test/Semantics/OpenACC/acc-resolve01.f90
index c55e02efd14de..4d85c26990c1c 100644
--- a/flang/test/Semantics/OpenACC/acc-resolve01.f90
+++ b/flang/test/Semantics/OpenACC/acc-resolve01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Data-Mapping Attribute Clauses
 ! 2.15.14 default Clause

diff  --git a/flang/test/Semantics/OpenACC/acc-resolve02.f90 b/flang/test/Semantics/OpenACC/acc-resolve02.f90
index b4df4d15bd8a6..861cb26e31a30 100644
--- a/flang/test/Semantics/OpenACC/acc-resolve02.f90
+++ b/flang/test/Semantics/OpenACC/acc-resolve02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 subroutine compute()
   integer :: a(3), c, i

diff  --git a/flang/test/Semantics/OpenACC/acc-routine-validity.f90 b/flang/test/Semantics/OpenACC/acc-routine-validity.f90
index 18d90ec6f0a9d..83583fcabf8f7 100644
--- a/flang/test/Semantics/OpenACC/acc-routine-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-routine-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.15.1 routine

diff  --git a/flang/test/Semantics/OpenACC/acc-serial-loop.f90 b/flang/test/Semantics/OpenACC/acc-serial-loop.f90
index c088bf892e78a..b0e04dd25a800 100644
--- a/flang/test/Semantics/OpenACC/acc-serial-loop.f90
+++ b/flang/test/Semantics/OpenACC/acc-serial-loop.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.11 Serial Loop

diff  --git a/flang/test/Semantics/OpenACC/acc-serial.f90 b/flang/test/Semantics/OpenACC/acc-serial.f90
index 2f206f5cfa342..a052ef4e476a8 100644
--- a/flang/test/Semantics/OpenACC/acc-serial.f90
+++ b/flang/test/Semantics/OpenACC/acc-serial.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.5.2 Serial

diff  --git a/flang/test/Semantics/OpenACC/acc-set-validity.f90 b/flang/test/Semantics/OpenACC/acc-set-validity.f90
index 4bc342e2f38b5..f914e254cfd25 100644
--- a/flang/test/Semantics/OpenACC/acc-set-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-set-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.14.3 Set

diff  --git a/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90 b/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
index 31fa3c9daf3da..de40963f99e04 100644
--- a/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-shutdown-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.14.2 Shutdown

diff  --git a/flang/test/Semantics/OpenACC/acc-update-validity.f90 b/flang/test/Semantics/OpenACC/acc-update-validity.f90
index fbf90fbbba91c..6563ef9e0912a 100644
--- a/flang/test/Semantics/OpenACC/acc-update-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-update-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.14.4 Update

diff  --git a/flang/test/Semantics/OpenACC/acc-wait-validity.f90 b/flang/test/Semantics/OpenACC/acc-wait-validity.f90
index c33bcbdecadca..25d603dad0502 100644
--- a/flang/test/Semantics/OpenACC/acc-wait-validity.f90
+++ b/flang/test/Semantics/OpenACC/acc-wait-validity.f90
@@ -1,5 +1,4 @@
-! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
-! REQUIRES: shell
+! RUN: %python %S/../test_errors.py %s %flang -fopenacc
 
 ! Check OpenACC clause validity for the following construct and directive:
 !   2.16.13 Wait

diff  --git a/flang/test/Semantics/allocate01.f90 b/flang/test/Semantics/allocate01.f90
index 257c8750c9585..a66e2467cbe4e 100644
--- a/flang/test/Semantics/allocate01.f90
+++ b/flang/test/Semantics/allocate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 9cf9e888450d2..25d34ccc2d7c3 100644
--- a/flang/test/Semantics/allocate02.f90
+++ b/flang/test/Semantics/allocate02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Check for semantic errors in ALLOCATE statements
 

diff  --git a/flang/test/Semantics/allocate03.f90 b/flang/test/Semantics/allocate03.f90
index c119ac675e1ce..f7cad583b2cec 100644
--- a/flang/test/Semantics/allocate03.f90
+++ b/flang/test/Semantics/allocate03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 b881b845e2ee1..bcccdca6680d6 100644
--- a/flang/test/Semantics/allocate04.f90
+++ b/flang/test/Semantics/allocate04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate05.f90 b/flang/test/Semantics/allocate05.f90
index b33f31606ba7e..eca6c9a7bc64c 100644
--- a/flang/test/Semantics/allocate05.f90
+++ b/flang/test/Semantics/allocate05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate06.f90 b/flang/test/Semantics/allocate06.f90
index 864f17a3c7cd7..a1ae51ddebffc 100644
--- a/flang/test/Semantics/allocate06.f90
+++ b/flang/test/Semantics/allocate06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in ALLOCATE statements
 
 

diff  --git a/flang/test/Semantics/allocate07.f90 b/flang/test/Semantics/allocate07.f90
index a948765deb921..8ebdbaa94cdd7 100644
--- a/flang/test/Semantics/allocate07.f90
+++ b/flang/test/Semantics/allocate07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 9223b14aa6427..cc074a149ae9e 100644
--- a/flang/test/Semantics/allocate08.f90
+++ b/flang/test/Semantics/allocate08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 03531a1ad2c58..f235cabac657b 100644
--- a/flang/test/Semantics/allocate09.f90
+++ b/flang/test/Semantics/allocate09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 05c73ce8a07df..5f7a1e5e719bb 100644
--- a/flang/test/Semantics/allocate10.f90
+++ b/flang/test/Semantics/allocate10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 b07b7a18ff4c6..960d45ffc7ee3 100644
--- a/flang/test/Semantics/allocate11.f90
+++ b/flang/test/Semantics/allocate11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 9504142a2cc12..ecc28d8dbe27d 100644
--- a/flang/test/Semantics/allocate12.f90
+++ b/flang/test/Semantics/allocate12.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in ALLOCATE statements
 
 subroutine C941_C942b_C950(xsrc, x1, a2, b2, cx1, ca2, cb1, cb2, c1, c2)

diff  --git a/flang/test/Semantics/allocate13.f90 b/flang/test/Semantics/allocate13.f90
index c939d19848ca2..fe23c57e11e71 100644
--- a/flang/test/Semantics/allocate13.f90
+++ b/flang/test/Semantics/allocate13.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 7257eb1e5551e..85a133d826764 100644
--- a/flang/test/Semantics/altreturn01.f90
+++ b/flang/test/Semantics/altreturn01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 ad7a4f8bc0614..a142871732198 100644
--- a/flang/test/Semantics/altreturn02.f90
+++ b/flang/test/Semantics/altreturn02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check subroutine with alt return
 
        SUBROUTINE TEST (N, *, *)

diff  --git a/flang/test/Semantics/altreturn03.f90 b/flang/test/Semantics/altreturn03.f90
index 703d22bc0b367..fdf3f2472ad1f 100644
--- a/flang/test/Semantics/altreturn03.f90
+++ b/flang/test/Semantics/altreturn03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 116c90acab8a6..9285bb730731e 100644
--- a/flang/test/Semantics/altreturn04.f90
+++ b/flang/test/Semantics/altreturn04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Functions cannot use alt return
 
 REAL FUNCTION altreturn01(X)

diff  --git a/flang/test/Semantics/altreturn05.f90 b/flang/test/Semantics/altreturn05.f90
index ad4f101cc14fd..e61827f85c1c2 100644
--- a/flang/test/Semantics/altreturn05.f90
+++ b/flang/test/Semantics/altreturn05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test extension: RETURN from main program
 
 return !ok

diff  --git a/flang/test/Semantics/altreturn06.f90 b/flang/test/Semantics/altreturn06.f90
index 4b5b606b9c36c..5be40e8009d5b 100644
--- a/flang/test/Semantics/altreturn06.f90
+++ b/flang/test/Semantics/altreturn06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test alternat return argument passing for internal and external subprograms
 ! Both of the following are OK
   call extSubprogram (*100)

diff  --git a/flang/test/Semantics/array-constr-big.f90 b/flang/test/Semantics/array-constr-big.f90
index 0f44aa125cc83..2b45edb7e3893 100644
--- a/flang/test/Semantics/array-constr-big.f90
+++ b/flang/test/Semantics/array-constr-big.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Ensure that evaluating a very large array constructor does not crash the
 ! compiler
 program BigArray

diff  --git a/flang/test/Semantics/array-constr-values.f90 b/flang/test/Semantics/array-constr-values.f90
index 09f8bc3dfe4b7..c814da2b6195f 100644
--- a/flang/test/Semantics/array-constr-values.f90
+++ b/flang/test/Semantics/array-constr-values.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Confirm enforcement of constraints and restrictions in 7.8
 ! C7110, C7111, C7112, C7113, C7114, C7115
 

diff  --git a/flang/test/Semantics/assign01.f90 b/flang/test/Semantics/assign01.f90
index 9d47a019b55e4..351fecfa103bf 100644
--- a/flang/test/Semantics/assign01.f90
+++ b/flang/test/Semantics/assign01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 76faa6f76f2f1..6e65d9014938a 100644
--- a/flang/test/Semantics/assign02.f90
+++ b/flang/test/Semantics/assign02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Pointer assignment constraints 10.2.2.2
 
 module m1

diff  --git a/flang/test/Semantics/assign03.f90 b/flang/test/Semantics/assign03.f90
index 830f17cdb61e5..8e502f31de9db 100644
--- a/flang/test/Semantics/assign03.f90
+++ b/flang/test/Semantics/assign03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 acc5ac8c8b156..daf3d54974f69 100644
--- a/flang/test/Semantics/assign04.f90
+++ b/flang/test/Semantics/assign04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 9.4.5
 subroutine s1
   type :: t(k, l)

diff  --git a/flang/test/Semantics/assign06.f90 b/flang/test/Semantics/assign06.f90
index 406bf2084f9da..4e65a779f55b1 100644
--- a/flang/test/Semantics/assign06.f90
+++ b/flang/test/Semantics/assign06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 980e4b6067dad..41a99c1d5d0a7 100644
--- a/flang/test/Semantics/assign07.f90
+++ b/flang/test/Semantics/assign07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/associated.f90 b/flang/test/Semantics/associated.f90
index 294035dbaf28d..509aa2dd762dc 100644
--- a/flang/test/Semantics/associated.f90
+++ b/flang/test/Semantics/associated.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests for the ASSOCIATED() and NULL() intrinsics
 subroutine assoc()
 

diff  --git a/flang/test/Semantics/bad-forward-type.f90 b/flang/test/Semantics/bad-forward-type.f90
index 875ef95a6dbf9..f7230d101d7e1 100644
--- a/flang/test/Semantics/bad-forward-type.f90
+++ b/flang/test/Semantics/bad-forward-type.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/bind-c01.f90 b/flang/test/Semantics/bind-c01.f90
index 36726ce7dd19d..2a35364128127 100644
--- a/flang/test/Semantics/bind-c01.f90
+++ b/flang/test/Semantics/bind-c01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for multiple symbols being defined with with same BIND(C) name
 
 module m1

diff  --git a/flang/test/Semantics/bindings01.f90 b/flang/test/Semantics/bindings01.f90
index fece75ab50c3c..75c3544842ba6 100644
--- a/flang/test/Semantics/bindings01.f90
+++ b/flang/test/Semantics/bindings01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Confirm enforcement of constraints and restrictions in 7.5.7.3
 ! and C733, C734 and C779, C780, C782, C783, C784, and C785.
 

diff  --git a/flang/test/Semantics/block-data01.f90 b/flang/test/Semantics/block-data01.f90
index 0a775d35a8639..5f69aa65d2604 100644
--- a/flang/test/Semantics/block-data01.f90
+++ b/flang/test/Semantics/block-data01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 a3759d2aea431..f6e9a780b8524 100644
--- a/flang/test/Semantics/blockconstruct01.f90
+++ b/flang/test/Semantics/blockconstruct01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 cffff31851448..b748b0a298e59 100644
--- a/flang/test/Semantics/blockconstruct02.f90
+++ b/flang/test/Semantics/blockconstruct02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 84187508473b1..75ffcadbb93cd 100644
--- a/flang/test/Semantics/blockconstruct03.f90
+++ b/flang/test/Semantics/blockconstruct03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests implemented for this standard:
 !            Block Construct
 ! C1109

diff  --git a/flang/test/Semantics/boz-literal-constants.f90 b/flang/test/Semantics/boz-literal-constants.f90
index e7dae868499d5..a0db6faddea91 100644
--- a/flang/test/Semantics/boz-literal-constants.f90
+++ b/flang/test/Semantics/boz-literal-constants.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Confirm enforcement of constraints and restrictions in 7.7
 ! C7107, C7108, C7109
 

diff  --git a/flang/test/Semantics/c_f_pointer.f90 b/flang/test/Semantics/c_f_pointer.f90
index 2e7bc9050d174..4a385f12920d3 100644
--- a/flang/test/Semantics/c_f_pointer.f90
+++ b/flang/test/Semantics/c_f_pointer.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Enforce 18.2.3.3
 
 program test

diff  --git a/flang/test/Semantics/call01.f90 b/flang/test/Semantics/call01.f90
index 5d6efe839e060..d75b72a4e32ab 100644
--- a/flang/test/Semantics/call01.f90
+++ b/flang/test/Semantics/call01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 bc0ee974aabdd..84bb2863866b6 100644
--- a/flang/test/Semantics/call02.f90
+++ b/flang/test/Semantics/call02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 db2e2360382e4..e89bce7ae0894 100644
--- a/flang/test/Semantics/call03.f90
+++ b/flang/test/Semantics/call03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 eb4f78f8f541f..6877f9c9fa939 100644
--- a/flang/test/Semantics/call04.f90
+++ b/flang/test/Semantics/call04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 ad512197f9a79..0aadb6a6b11d8 100644
--- a/flang/test/Semantics/call05.f90
+++ b/flang/test/Semantics/call05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 5e2728f69a84a..1f4b17fed5fda 100644
--- a/flang/test/Semantics/call06.f90
+++ b/flang/test/Semantics/call06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 444331fd17c4f..db5e0a6914597 100644
--- a/flang/test/Semantics/call07.f90
+++ b/flang/test/Semantics/call07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 5da55d4e04b3e..f4c690e0c96e0 100644
--- a/flang/test/Semantics/call08.f90
+++ b/flang/test/Semantics/call08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 c3398293c8eeb..23591687189ef 100644
--- a/flang/test/Semantics/call09.f90
+++ b/flang/test/Semantics/call09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test 15.5.2.9(2,3,5) dummy procedure requirements
 ! C843
 !   An entity with the INTENT attribute shall be a dummy data object or a 

diff  --git a/flang/test/Semantics/call10.f90 b/flang/test/Semantics/call10.f90
index 2ef3a5add6040..deb6e373013bb 100644
--- a/flang/test/Semantics/call10.f90
+++ b/flang/test/Semantics/call10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 086537f3c6968..4307571ba749b 100644
--- a/flang/test/Semantics/call11.f90
+++ b/flang/test/Semantics/call11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 8838366021185..4780a95000dc0 100644
--- a/flang/test/Semantics/call12.f90
+++ b/flang/test/Semantics/call12.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 47786fa9f9cd6..a5ef1ca34a66d 100644
--- a/flang/test/Semantics/call13.f90
+++ b/flang/test/Semantics/call13.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2bf5d53ec56da..477c22b02f2cd 100644
--- a/flang/test/Semantics/call14.f90
+++ b/flang/test/Semantics/call14.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 c236ef060bf73..842103b4aca30 100644
--- a/flang/test/Semantics/call15.f90
+++ b/flang/test/Semantics/call15.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/call16.f90 b/flang/test/Semantics/call16.f90
index 12cab97efcf07..37e82b1668206 100644
--- a/flang/test/Semantics/call16.f90
+++ b/flang/test/Semantics/call16.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Test that intrinsic functions used as subroutines and vice versa are caught.
 

diff  --git a/flang/test/Semantics/call18.f90 b/flang/test/Semantics/call18.f90
index ae10ea9c94d94..fb5895fe69b2e 100644
--- a/flang/test/Semantics/call18.f90
+++ b/flang/test/Semantics/call18.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Ensure that references to functions that return pointers can serve as
 ! "variables" in actual arguments.  All of these uses are conforming and
 ! no errors should be reported.

diff  --git a/flang/test/Semantics/call19.f90 b/flang/test/Semantics/call19.f90
index d102eb687d0c6..753ff95d280df 100644
--- a/flang/test/Semantics/call19.f90
+++ b/flang/test/Semantics/call19.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Ensures that things that aren't procedures aren't allowed to be called.
 module m
   integer :: i

diff  --git a/flang/test/Semantics/call20.f90 b/flang/test/Semantics/call20.f90
index 2ce7b1ced2f63..91ce2bfccc7f6 100644
--- a/flang/test/Semantics/call20.f90
+++ b/flang/test/Semantics/call20.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Test that the interface of specific intrinsics passed as dummy arguments
 ! are correctly validated against actual arguments explicit interface.

diff  --git a/flang/test/Semantics/case01.f90 b/flang/test/Semantics/case01.f90
index e863b71d7332a..42eb07d20982f 100644
--- a/flang/test/Semantics/case01.f90
+++ b/flang/test/Semantics/case01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 b074c9b990703..0a6f88a7e748c 100644
--- a/flang/test/Semantics/coarrays01.f90
+++ b/flang/test/Semantics/coarrays01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test selector and team-value in CHANGE TEAM statement
 
 ! OK

diff  --git a/flang/test/Semantics/complex01.f90 b/flang/test/Semantics/complex01.f90
index cf7fd9cc2b1fb..f28ffe133604d 100644
--- a/flang/test/Semantics/complex01.f90
+++ b/flang/test/Semantics/complex01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 321d6a1c5c7f7..4eb00df8ce8d4 100644
--- a/flang/test/Semantics/computed-goto01.f90
+++ b/flang/test/Semantics/computed-goto01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 a51e53663b22f..f613404af3da2 100644
--- a/flang/test/Semantics/computed-goto02.f90
+++ b/flang/test/Semantics/computed-goto02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 90e8a6e78a875..5981a65d9c386 100644
--- a/flang/test/Semantics/critical01.f90
+++ b/flang/test/Semantics/critical01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !C1117
 
 subroutine test1(a, i)

diff  --git a/flang/test/Semantics/critical02.f90 b/flang/test/Semantics/critical02.f90
index f7822b7f15688..10581f9fd805b 100644
--- a/flang/test/Semantics/critical02.f90
+++ b/flang/test/Semantics/critical02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !C1118
 
 subroutine test1

diff  --git a/flang/test/Semantics/critical03.f90 b/flang/test/Semantics/critical03.f90
index 0683a842d8315..26b4a9f133d37 100644
--- a/flang/test/Semantics/critical03.f90
+++ b/flang/test/Semantics/critical03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !C1119
 
 subroutine test1(a, i)

diff  --git a/flang/test/Semantics/data01.f90 b/flang/test/Semantics/data01.f90
index 635e7c53e2fdc..f8c8d379ec981 100644
--- a/flang/test/Semantics/data01.f90
+++ b/flang/test/Semantics/data01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !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 eb4d801f6972a..11235a751c732 100644
--- a/flang/test/Semantics/data02.f90
+++ b/flang/test/Semantics/data02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 e4ad9956ef86b..b3ed3382036f6 100644
--- a/flang/test/Semantics/data03.f90
+++ b/flang/test/Semantics/data03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !Testing data constraints : C874 - C875, C878 - C881 
 module m
     integer, target :: modarray(1)

diff  --git a/flang/test/Semantics/data04.f90 b/flang/test/Semantics/data04.f90
index d69c8d384a38e..5d862b2c23460 100644
--- a/flang/test/Semantics/data04.f90
+++ b/flang/test/Semantics/data04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !Testing data constraints : C876, C877
 module m
   integer :: first

diff  --git a/flang/test/Semantics/data06.f90 b/flang/test/Semantics/data06.f90
index 953da87e97819..b8dfdb31f37fd 100644
--- a/flang/test/Semantics/data06.f90
+++ b/flang/test/Semantics/data06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! DATA statement errors
 subroutine s1
   type :: t1

diff  --git a/flang/test/Semantics/data07.f90 b/flang/test/Semantics/data07.f90
index 0bf08a964fe34..ddb1f8b282353 100644
--- a/flang/test/Semantics/data07.f90
+++ b/flang/test/Semantics/data07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
  contains
   subroutine s1

diff  --git a/flang/test/Semantics/data10.f90 b/flang/test/Semantics/data10.f90
index af541fccdccc9..a46465c2f6acb 100644
--- a/flang/test/Semantics/data10.f90
+++ b/flang/test/Semantics/data10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 type :: t
   integer :: n
 end type

diff  --git a/flang/test/Semantics/data12.f90 b/flang/test/Semantics/data12.f90
index 0ceba176a8bc0..fa6120c1b4282 100644
--- a/flang/test/Semantics/data12.f90
+++ b/flang/test/Semantics/data12.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 type :: t1
   sequence
   integer :: m = 123

diff  --git a/flang/test/Semantics/deallocate01.f90 b/flang/test/Semantics/deallocate01.f90
index 95fe128e6cb87..88c29d0814a28 100644
--- a/flang/test/Semantics/deallocate01.f90
+++ b/flang/test/Semantics/deallocate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test that DEALLOCATE works
 
 INTEGER, PARAMETER :: maxvalue=1024

diff  --git a/flang/test/Semantics/deallocate04.f90 b/flang/test/Semantics/deallocate04.f90
index 43786dfa11bb7..32ead587d8c72 100644
--- a/flang/test/Semantics/deallocate04.f90
+++ b/flang/test/Semantics/deallocate04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 e065f07ab689a..0363a1f9a6b85 100644
--- a/flang/test/Semantics/deallocate05.f90
+++ b/flang/test/Semantics/deallocate05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in DEALLOCATE statements
 
 Module share

diff  --git a/flang/test/Semantics/deallocate06.f90 b/flang/test/Semantics/deallocate06.f90
index 360091ea8de0d..16ae9f9146a87 100644
--- a/flang/test/Semantics/deallocate06.f90
+++ b/flang/test/Semantics/deallocate06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Test deallocate of use- and host-associated variables
 module m1

diff  --git a/flang/test/Semantics/doconcurrent01.f90 b/flang/test/Semantics/doconcurrent01.f90
index 67294fc76a4db..84297fbecc3e5 100644
--- a/flang/test/Semantics/doconcurrent01.f90
+++ b/flang/test/Semantics/doconcurrent01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/doconcurrent05.f90 b/flang/test/Semantics/doconcurrent05.f90
index c8961abbcc71e..a826e06dcb075 100644
--- a/flang/test/Semantics/doconcurrent05.f90
+++ b/flang/test/Semantics/doconcurrent05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 0a990a55e08bb..917554d38b706 100644
--- a/flang/test/Semantics/doconcurrent06.f90
+++ b/flang/test/Semantics/doconcurrent06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/doconcurrent08.f90 b/flang/test/Semantics/doconcurrent08.f90
index 214a93178324d..e56b980dbf442 100644
--- a/flang/test/Semantics/doconcurrent08.f90
+++ b/flang/test/Semantics/doconcurrent08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 ec5375ff549b0..29286dbd60f8f 100644
--- a/flang/test/Semantics/dosemantics01.f90
+++ b/flang/test/Semantics/dosemantics01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 a4c0ce1f5fddb..563736b721cc0 100644
--- a/flang/test/Semantics/dosemantics02.f90
+++ b/flang/test/Semantics/dosemantics02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 5aedfcbc41f2d..59c8ddaadeff5 100644
--- a/flang/test/Semantics/dosemantics03.f90
+++ b/flang/test/Semantics/dosemantics03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -pedantic -Werror
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -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

diff  --git a/flang/test/Semantics/dosemantics04.f90 b/flang/test/Semantics/dosemantics04.f90
index 6c3cdb8594fec..1409f6d323d3f 100644
--- a/flang/test/Semantics/dosemantics04.f90
+++ b/flang/test/Semantics/dosemantics04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 ff1b23092cf91..b77e078fd69c9 100644
--- a/flang/test/Semantics/dosemantics05.f90
+++ b/flang/test/Semantics/dosemantics05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 8059b4f9651b6..1e7fd89c2ebae 100644
--- a/flang/test/Semantics/dosemantics06.f90
+++ b/flang/test/Semantics/dosemantics06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 be1bb9f770524..b64659ae6c291 100644
--- a/flang/test/Semantics/dosemantics07.f90
+++ b/flang/test/Semantics/dosemantics07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !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 005f65b82908d..1dc5ba65f6460 100644
--- a/flang/test/Semantics/dosemantics08.f90
+++ b/flang/test/Semantics/dosemantics08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 4f2c5bf180400..9e6bca2cca24c 100644
--- a/flang/test/Semantics/dosemantics09.f90
+++ b/flang/test/Semantics/dosemantics09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !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 a17f82723b6db..0aad3c5320a58 100644
--- a/flang/test/Semantics/dosemantics10.f90
+++ b/flang/test/Semantics/dosemantics10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 e6ab9ebf3f1a3..5ceb8348c6172 100644
--- a/flang/test/Semantics/dosemantics11.f90
+++ b/flang/test/Semantics/dosemantics11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 40bb23126f3da..e5a390fa8cb93 100644
--- a/flang/test/Semantics/dosemantics12.f90
+++ b/flang/test/Semantics/dosemantics12.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 5189389f0f944..8255e708a7d96 100644
--- a/flang/test/Semantics/entry01.f90
+++ b/flang/test/Semantics/entry01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests valid and invalid ENTRY statements
 
 module m1

diff  --git a/flang/test/Semantics/equivalence01.f90 b/flang/test/Semantics/equivalence01.f90
index bab563d7f007c..d69113ac258e8 100644
--- a/flang/test/Semantics/equivalence01.f90
+++ b/flang/test/Semantics/equivalence01.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang_fc1
 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 31aa92c26c52f..221a671b5b7c1 100644
--- a/flang/test/Semantics/expr-errors01.f90
+++ b/flang/test/Semantics/expr-errors01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 0008765886810..8d72cb6c30d96 100644
--- a/flang/test/Semantics/expr-errors02.f90
+++ b/flang/test/Semantics/expr-errors02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test specification expressions
 
 module m

diff  --git a/flang/test/Semantics/expr-errors03.f90 b/flang/test/Semantics/expr-errors03.f90
index 6db03a4cbeaaa..4a08c06ac9d63 100644
--- a/flang/test/Semantics/expr-errors03.f90
+++ b/flang/test/Semantics/expr-errors03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Regression test for subscript error recovery
 module m
   implicit none

diff  --git a/flang/test/Semantics/final01.f90 b/flang/test/Semantics/final01.f90
index 71d031af37a00..07188cfdbe3cc 100644
--- a/flang/test/Semantics/final01.f90
+++ b/flang/test/Semantics/final01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test FINAL subroutine constraints C786-C789
 module m1
   external :: external

diff  --git a/flang/test/Semantics/forall01.f90 b/flang/test/Semantics/forall01.f90
index 97db40850c030..1ace7627abe60 100644
--- a/flang/test/Semantics/forall01.f90
+++ b/flang/test/Semantics/forall01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine forall1
   real :: a(9)
   !ERROR: 'i' is already declared in this scoping unit

diff  --git a/flang/test/Semantics/if_arith01.f90 b/flang/test/Semantics/if_arith01.f90
index b7b039915606d..a6714f29219ed 100644
--- a/flang/test/Semantics/if_arith01.f90
+++ b/flang/test/Semantics/if_arith01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 95af99978dc5f..e20fd46f994c7 100644
--- a/flang/test/Semantics/if_arith02.f90
+++ b/flang/test/Semantics/if_arith02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 7b55e38df253b..3af7d6de3bc70 100644
--- a/flang/test/Semantics/if_arith03.f90
+++ b/flang/test/Semantics/if_arith03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 !ERROR: Label '600' was not found
 if ( A ) 100, 200, 600

diff  --git a/flang/test/Semantics/if_arith04.f90 b/flang/test/Semantics/if_arith04.f90
index 067031af9c44a..6e98b5397f5dc 100644
--- a/flang/test/Semantics/if_arith04.f90
+++ b/flang/test/Semantics/if_arith04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 9fb1344ff259d..0d9cbe483d9d2 100644
--- a/flang/test/Semantics/if_construct01.f90
+++ b/flang/test/Semantics/if_construct01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 03fd433f75f7f..c2dc759b726fa 100644
--- a/flang/test/Semantics/if_construct02.f90
+++ b/flang/test/Semantics/if_construct02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 64d0b41cea549..d53a1b9290128 100644
--- a/flang/test/Semantics/if_stmt01.f90
+++ b/flang/test/Semantics/if_stmt01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 cb9abe58d1c63..46c7fcd9f594a 100644
--- a/flang/test/Semantics/if_stmt02.f90
+++ b/flang/test/Semantics/if_stmt02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !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 3d012477389ec..eb61a0b7d5b53 100644
--- a/flang/test/Semantics/if_stmt03.f90
+++ b/flang/test/Semantics/if_stmt03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2ed9e71437c1d..8d82685274ac2 100644
--- a/flang/test/Semantics/implicit01.f90
+++ b/flang/test/Semantics/implicit01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 a5f2df1309860..6e793faed8961 100644
--- a/flang/test/Semantics/implicit02.f90
+++ b/flang/test/Semantics/implicit02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 0f2aa6ad2de3d..928829c65137e 100644
--- a/flang/test/Semantics/implicit03.f90
+++ b/flang/test/Semantics/implicit03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 fcc438786b5f1..9c065834f361e 100644
--- a/flang/test/Semantics/implicit04.f90
+++ b/flang/test/Semantics/implicit04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 e5b52812f43ab..f033aa2cc95e6 100644
--- a/flang/test/Semantics/implicit05.f90
+++ b/flang/test/Semantics/implicit05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 11a2e82638d75..4486d07769d4d 100644
--- a/flang/test/Semantics/implicit06.f90
+++ b/flang/test/Semantics/implicit06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 4a6eadbbf3df1..30e57e1d55e91 100644
--- a/flang/test/Semantics/implicit07.f90
+++ b/flang/test/Semantics/implicit07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 implicit none(external)
 external x
 integer :: f, i

diff  --git a/flang/test/Semantics/implicit08.f90 b/flang/test/Semantics/implicit08.f90
index a4984132d565f..9b42bc2612c40 100644
--- a/flang/test/Semantics/implicit08.f90
+++ b/flang/test/Semantics/implicit08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1
   block
     !ERROR: IMPLICIT statement is not allowed in a BLOCK construct

diff  --git a/flang/test/Semantics/implicit09.f90 b/flang/test/Semantics/implicit09.f90
index bda24f6f81b0a..95bfd4e9e66bb 100644
--- a/flang/test/Semantics/implicit09.f90
+++ b/flang/test/Semantics/implicit09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fimplicit-none-type-never
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fimplicit-none-type-never
 subroutine s1
   implicit none
   i = j + k  ! would be error without -fimplicit-none-type-never

diff  --git a/flang/test/Semantics/implicit10.f90 b/flang/test/Semantics/implicit10.f90
index c1ef7b1f83a69..081f236f3a4fd 100644
--- a/flang/test/Semantics/implicit10.f90
+++ b/flang/test/Semantics/implicit10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fimplicit-none
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fimplicit-none
 
 !ERROR: No explicit type declared for 'f'
 function f()

diff  --git a/flang/test/Semantics/implicit11.f90 b/flang/test/Semantics/implicit11.f90
index 0a52e1ac9d26f..3c68ab5b848b2 100644
--- a/flang/test/Semantics/implicit11.f90
+++ b/flang/test/Semantics/implicit11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Test use of implicitly declared variable in specification expression
 

diff  --git a/flang/test/Semantics/init01.f90 b/flang/test/Semantics/init01.f90
index 89b2c41a99c0b..7e962596dd263 100644
--- a/flang/test/Semantics/init01.f90
+++ b/flang/test/Semantics/init01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Initializer error tests
 
 subroutine objectpointers(j)

diff  --git a/flang/test/Semantics/int-literals.f90 b/flang/test/Semantics/int-literals.f90
index 09d0914f1eef1..2344d6b9595c6 100644
--- a/flang/test/Semantics/int-literals.f90
+++ b/flang/test/Semantics/int-literals.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 14cdd1c980c53..d3d2df1cdb1a8 100644
--- a/flang/test/Semantics/io01.f90
+++ b/flang/test/Semantics/io01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   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 3ff06cc15a8a3..40be023828c48 100644
--- a/flang/test/Semantics/io02.f90
+++ b/flang/test/Semantics/io02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   integer :: unit10 = 10
   integer :: unit11 = 11
   integer, parameter :: const_stat = 6666

diff  --git a/flang/test/Semantics/io03.f90 b/flang/test/Semantics/io03.f90
index 69f591493ac7f..70f25ad524e8a 100644
--- a/flang/test/Semantics/io03.f90
+++ b/flang/test/Semantics/io03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   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 e7baa54c0c117..e53b1ebf43b3a 100644
--- a/flang/test/Semantics/io04.f90
+++ b/flang/test/Semantics/io04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   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 ad80f93ec0161..851ec5fee1114 100644
--- a/flang/test/Semantics/io05.f90
+++ b/flang/test/Semantics/io05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   character*20 c(25), cv
   character(kind=1,len=59) msg
   character, parameter :: const_round = "c'est quoi?"

diff  --git a/flang/test/Semantics/io06.f90 b/flang/test/Semantics/io06.f90
index e9068630e08e3..e3bc7602a66a3 100644
--- a/flang/test/Semantics/io06.f90
+++ b/flang/test/Semantics/io06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   character(kind=1,len=100) msg1
   character(kind=2,len=200) msg2
   character, parameter :: const_msg = 'doof'

diff  --git a/flang/test/Semantics/io07.f90 b/flang/test/Semantics/io07.f90
index 121eff8ae9c81..5c4c2b419d978 100644
--- a/flang/test/Semantics/io07.f90
+++ b/flang/test/Semantics/io07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 1001 format(A)
 
      !ERROR: Format statement must be labeled

diff  --git a/flang/test/Semantics/io08.f90 b/flang/test/Semantics/io08.f90
index 7c9f924e26f96..c074e1562e222 100644
--- a/flang/test/Semantics/io08.f90
+++ b/flang/test/Semantics/io08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   write(*,*)
   write(*,'()')
   write(*,'(A)')

diff  --git a/flang/test/Semantics/io09.f90 b/flang/test/Semantics/io09.f90
index c9b1948ad79b2..495cbf059005c 100644
--- a/flang/test/Semantics/io09.f90
+++ b/flang/test/Semantics/io09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
   !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 6322073b94ea8..ef7008bf9d2da 100644
--- a/flang/test/Semantics/io10.f90
+++ b/flang/test/Semantics/io10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -pedantic
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
 
   write(*, '(B0)')
   write(*, '(B3)')

diff  --git a/flang/test/Semantics/io11.f90 b/flang/test/Semantics/io11.f90
index 4de8b52bdebbc..35ea874237649 100644
--- a/flang/test/Semantics/io11.f90
+++ b/flang/test/Semantics/io11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Tests for defined input/output.  See 12.6.4.8 and 15.4.3.2, and C777
 module m1

diff  --git a/flang/test/Semantics/kinds02.f90 b/flang/test/Semantics/kinds02.f90
index 46cd6ebcc2911..b02659e701f31 100644
--- a/flang/test/Semantics/kinds02.f90
+++ b/flang/test/Semantics/kinds02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/kinds04.f90 b/flang/test/Semantics/kinds04.f90
index f03126d98b0a7..26957d9cfc1dc 100644
--- a/flang/test/Semantics/kinds04.f90
+++ b/flang/test/Semantics/kinds04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/label11.f90 b/flang/test/Semantics/label11.f90
index 6c45edc251f2d..ebd743a6dbc7d 100644
--- a/flang/test/Semantics/label11.f90
+++ b/flang/test/Semantics/label11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! C739 If END TYPE is followed by a type-name, the type-name shall be the
 ! same as that in the corresponding derived-type-stmt.
 ! C1401 The program-name shall not be included in the end-program-stmt unless

diff  --git a/flang/test/Semantics/label16.f90 b/flang/test/Semantics/label16.f90
index f6cb3d49f38f9..73394209e200f 100644
--- a/flang/test/Semantics/label16.f90
+++ b/flang/test/Semantics/label16.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 subroutine x(n)
    call x1(n)

diff  --git a/flang/test/Semantics/misc-declarations.f90 b/flang/test/Semantics/misc-declarations.f90
index 081a497afa0a8..485b82d36062b 100644
--- a/flang/test/Semantics/misc-declarations.f90
+++ b/flang/test/Semantics/misc-declarations.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/modfile41.f90 b/flang/test/Semantics/modfile41.f90
index e988e77514df6..caba833e8d32a 100644
--- a/flang/test/Semantics/modfile41.f90
+++ b/flang/test/Semantics/modfile41.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test USE statements that use same module multiple times mixed with rename
 ! clauses and ONLY clauses
 module m1

diff  --git a/flang/test/Semantics/namelist01.f90 b/flang/test/Semantics/namelist01.f90
index d52e5dbd62d66..b14bf04ac91f9 100644
--- a/flang/test/Semantics/namelist01.f90
+++ b/flang/test/Semantics/namelist01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test for checking namelist constraints, C8103-C8105
 
 module dup

diff  --git a/flang/test/Semantics/null-init.f90 b/flang/test/Semantics/null-init.f90
index d5ed4d12f8094..a1ac29ed39974 100644
--- a/flang/test/Semantics/null-init.f90
+++ b/flang/test/Semantics/null-init.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests valid and invalid NULL initializers
 
 module m1

diff  --git a/flang/test/Semantics/null01.f90 b/flang/test/Semantics/null01.f90
index 65af2d91a988a..73ee76084afa2 100644
--- a/flang/test/Semantics/null01.f90
+++ b/flang/test/Semantics/null01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! NULL() intrinsic function error tests
 
 subroutine test

diff  --git a/flang/test/Semantics/nullify01.f90 b/flang/test/Semantics/nullify01.f90
index 3fdf5d4fead0a..21ffa81fbbd27 100644
--- a/flang/test/Semantics/nullify01.f90
+++ b/flang/test/Semantics/nullify01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test that NULLIFY works
 
 Module share

diff  --git a/flang/test/Semantics/nullify02.f90 b/flang/test/Semantics/nullify02.f90
index bccc1740cebc3..81d108ac6d220 100644
--- a/flang/test/Semantics/nullify02.f90
+++ b/flang/test/Semantics/nullify02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in NULLIFY statements
 
 INTEGER, PARAMETER :: maxvalue=1024

diff  --git a/flang/test/Semantics/num_images.f90 b/flang/test/Semantics/num_images.f90
index f77fc83f714f0..03bd0f4f46775 100644
--- a/flang/test/Semantics/num_images.f90
+++ b/flang/test/Semantics/num_images.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Check for semantic errors in num_images() function calls
 
 subroutine test

diff  --git a/flang/test/Semantics/omp-allocate-directive.f90 b/flang/test/Semantics/omp-allocate-directive.f90
index 4eb1669a35e88..00c0f6baacf54 100644
--- a/flang/test/Semantics/omp-allocate-directive.f90
+++ b/flang/test/Semantics/omp-allocate-directive.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! Check OpenMP Allocate directive
 use omp_lib
 

diff  --git a/flang/test/Semantics/omp-allocate01.f90 b/flang/test/Semantics/omp-allocate01.f90
index 73d37013c2e92..74f87887578d5 100644
--- a/flang/test/Semantics/omp-allocate01.f90
+++ b/flang/test/Semantics/omp-allocate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! The allocate directive must appear in the same scope as the declarations of

diff  --git a/flang/test/Semantics/omp-allocate02.f90 b/flang/test/Semantics/omp-allocate02.f90
index 1abc7b5781861..ba3957f7b96ba 100644
--- a/flang/test/Semantics/omp-allocate02.f90
+++ b/flang/test/Semantics/omp-allocate02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! At most one allocator clause can appear on the allocate directive.

diff  --git a/flang/test/Semantics/omp-allocate03.f90 b/flang/test/Semantics/omp-allocate03.f90
index 8d3c0cca494a7..3ff6f7a1a50e8 100644
--- a/flang/test/Semantics/omp-allocate03.f90
+++ b/flang/test/Semantics/omp-allocate03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! A variable that is part of another variable (as an array or

diff  --git a/flang/test/Semantics/omp-allocate04.f90 b/flang/test/Semantics/omp-allocate04.f90
index 9f5e0caaaf041..d5d97305756ed 100644
--- a/flang/test/Semantics/omp-allocate04.f90
+++ b/flang/test/Semantics/omp-allocate04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! Only the allocator clause is allowed on the allocate directive

diff  --git a/flang/test/Semantics/omp-allocate05.f90 b/flang/test/Semantics/omp-allocate05.f90
index f128358ab39af..89cf83dbe521f 100644
--- a/flang/test/Semantics/omp-allocate05.f90
+++ b/flang/test/Semantics/omp-allocate05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! allocate directives that appear in a target region must specify an allocator

diff  --git a/flang/test/Semantics/omp-allocate06.f90 b/flang/test/Semantics/omp-allocate06.f90
index aa75d47b9acf8..22651348bf501 100644
--- a/flang/test/Semantics/omp-allocate06.f90
+++ b/flang/test/Semantics/omp-allocate06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive 
 ! List items specified in the allocate directive must not have the ALLOCATABLE attribute unless the directive is associated with an

diff  --git a/flang/test/Semantics/omp-allocate07.f90 b/flang/test/Semantics/omp-allocate07.f90
index 2c791280fd716..067fc42e5f5ff 100644
--- a/flang/test/Semantics/omp-allocate07.f90
+++ b/flang/test/Semantics/omp-allocate07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive 
 ! A type parameter inquiry cannot appear in an allocate directive.

diff  --git a/flang/test/Semantics/omp-allocate08.f90 b/flang/test/Semantics/omp-allocate08.f90
index 8d524efb54c57..2594933733ccc 100644
--- a/flang/test/Semantics/omp-allocate08.f90
+++ b/flang/test/Semantics/omp-allocate08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! If list items within the ALLOCATE directive have the SAVE attribute, are a common block name, or are declared in the scope of a

diff  --git a/flang/test/Semantics/omp-atomic.f90 b/flang/test/Semantics/omp-atomic.f90
index 6fc500ca3fd8e..86d9457011b9d 100644
--- a/flang/test/Semantics/omp-atomic.f90
+++ b/flang/test/Semantics/omp-atomic.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 use omp_lib
 ! Check OpenMP 2.13.6 atomic Construct
 

diff  --git a/flang/test/Semantics/omp-atomic01.f90 b/flang/test/Semantics/omp-atomic01.f90
index 8a8fa4211314d..9f9e26f9081f9 100644
--- a/flang/test/Semantics/omp-atomic01.f90
+++ b/flang/test/Semantics/omp-atomic01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! Semantic checks for OpenMP 5.0 standard 2.17.7 atomic Construct.
 
 use omp_lib

diff  --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90
index e4dd150459a49..f6150a2901b2b 100644
--- a/flang/test/Semantics/omp-clause-validity01.f90
+++ b/flang/test/Semantics/omp-clause-validity01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 use omp_lib
 ! 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 c43713083e875..c8d3d2621c170 100644
--- a/flang/test/Semantics/omp-combined-constructs.f90
+++ b/flang/test/Semantics/omp-combined-constructs.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 program main
   implicit none

diff  --git a/flang/test/Semantics/omp-copyin01.f90 b/flang/test/Semantics/omp-copyin01.f90
index 389e0f7c8f5f0..6aba8a2769aa8 100644
--- a/flang/test/Semantics/omp-copyin01.f90
+++ b/flang/test/Semantics/omp-copyin01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.1 copyin Clause
 ! A list item that appears in a copyin clause must be threadprivate

diff  --git a/flang/test/Semantics/omp-copyin02.f90 b/flang/test/Semantics/omp-copyin02.f90
index f1d02ff030a31..8c92cccfa9177 100644
--- a/flang/test/Semantics/omp-copyin02.f90
+++ b/flang/test/Semantics/omp-copyin02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.1 copyin Clause
 ! A common block name that appears in a copyin clause must be declared to be

diff  --git a/flang/test/Semantics/omp-copyin03.f90 b/flang/test/Semantics/omp-copyin03.f90
index 2d856c769feb1..54a260427bcff 100644
--- a/flang/test/Semantics/omp-copyin03.f90
+++ b/flang/test/Semantics/omp-copyin03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.1 copyin Clause
 ! A list item that appears in a copyin clause must be threadprivate.

diff  --git a/flang/test/Semantics/omp-copyin04.f90 b/flang/test/Semantics/omp-copyin04.f90
index c73c62816b1ff..297d42ab3cffb 100644
--- a/flang/test/Semantics/omp-copyin04.f90
+++ b/flang/test/Semantics/omp-copyin04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.1 copyin Clause
 ! A list item that appears in a copyin clause must be threadprivate

diff  --git a/flang/test/Semantics/omp-copyin05.f90 b/flang/test/Semantics/omp-copyin05.f90
index 5d05a92d0cabd..8f1ba29a5ce4c 100644
--- a/flang/test/Semantics/omp-copyin05.f90
+++ b/flang/test/Semantics/omp-copyin05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.1 copyin Clause
 ! A common block name that appears in a copyin clause must be declared to be

diff  --git a/flang/test/Semantics/omp-copyprivate01.f90 b/flang/test/Semantics/omp-copyprivate01.f90
index 75c9d4aacc891..37912ed1ef3d7 100644
--- a/flang/test/Semantics/omp-copyprivate01.f90
+++ b/flang/test/Semantics/omp-copyprivate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.2 copyprivate Clause
 ! A list item that appears in a copyprivate clause may not appear in a

diff  --git a/flang/test/Semantics/omp-copyprivate02.f90 b/flang/test/Semantics/omp-copyprivate02.f90
index fe62eae473e1b..e2d408aac781e 100644
--- a/flang/test/Semantics/omp-copyprivate02.f90
+++ b/flang/test/Semantics/omp-copyprivate02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.2 copyprivate Clause
 ! Pointers with the INTENT(IN) attribute may not appear in a copyprivate clause.

diff  --git a/flang/test/Semantics/omp-copyprivate03.f90 b/flang/test/Semantics/omp-copyprivate03.f90
index b19e69795b985..0ca4909817ad8 100644
--- a/flang/test/Semantics/omp-copyprivate03.f90
+++ b/flang/test/Semantics/omp-copyprivate03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.4.2 copyprivate Clause
 ! All list items that appear in the copyprivate clause must be either

diff  --git a/flang/test/Semantics/omp-declarative-directive.f90 b/flang/test/Semantics/omp-declarative-directive.f90
index dca3d897bb7b0..15744d9797935 100644
--- a/flang/test/Semantics/omp-declarative-directive.f90
+++ b/flang/test/Semantics/omp-declarative-directive.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! Check OpenMP declarative directives
 

diff  --git a/flang/test/Semantics/omp-default.f90 b/flang/test/Semantics/omp-default.f90
index 5955a3a5facd1..e4f364cf365e6 100644
--- a/flang/test/Semantics/omp-default.f90
+++ b/flang/test/Semantics/omp-default.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.1 default Clause
 program omp_default

diff  --git a/flang/test/Semantics/omp-default02.f90 b/flang/test/Semantics/omp-default02.f90
index b95e673ed34c3..f508d6acfba3e 100644
--- a/flang/test/Semantics/omp-default02.f90
+++ b/flang/test/Semantics/omp-default02.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.1 default Clause - a positive test case.
 

diff  --git a/flang/test/Semantics/omp-depend01.f90 b/flang/test/Semantics/omp-depend01.f90
index bb420563ed36b..aedcb8b66eaaa 100644
--- a/flang/test/Semantics/omp-depend01.f90
+++ b/flang/test/Semantics/omp-depend01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.13.9 Depend Clause
 ! List items used in depend clauses cannot be zero-length array sections.

diff  --git a/flang/test/Semantics/omp-depend02.f90 b/flang/test/Semantics/omp-depend02.f90
index aa30da4278037..e00c8510f2544 100644
--- a/flang/test/Semantics/omp-depend02.f90
+++ b/flang/test/Semantics/omp-depend02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.13.9 Depend Clause
 ! A variable that is part of another variable

diff  --git a/flang/test/Semantics/omp-depend03.f90 b/flang/test/Semantics/omp-depend03.f90
index 68cff43b53d53..9bca93a2a8a1b 100644
--- a/flang/test/Semantics/omp-depend03.f90
+++ b/flang/test/Semantics/omp-depend03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.13.9 Depend Clause
 ! Coarrays are not supported in depend clause

diff  --git a/flang/test/Semantics/omp-device-constructs.f90 b/flang/test/Semantics/omp-device-constructs.f90
index 301b102b2ca7a..d5a1acc69721c 100644
--- a/flang/test/Semantics/omp-device-constructs.f90
+++ b/flang/test/Semantics/omp-device-constructs.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! Check OpenMP clause validity for the following directives:
 !     2.10 Device constructs
 program main

diff  --git a/flang/test/Semantics/omp-do-collapse-positivecases.f90 b/flang/test/Semantics/omp-do-collapse-positivecases.f90
index 3959a3579c93d..fecd4d582640a 100644
--- a/flang/test/Semantics/omp-do-collapse-positivecases.f90
+++ b/flang/test/Semantics/omp-do-collapse-positivecases.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Collapse Clause Positive cases
 

diff  --git a/flang/test/Semantics/omp-do-collapse.f90 b/flang/test/Semantics/omp-do-collapse.f90
index c2af35b189bdd..c7404e059489a 100644
--- a/flang/test/Semantics/omp-do-collapse.f90
+++ b/flang/test/Semantics/omp-do-collapse.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Collapse Clause
 program omp_doCollapse

diff  --git a/flang/test/Semantics/omp-do-cycle.f90 b/flang/test/Semantics/omp-do-cycle.f90
index f3bc7bf29c221..f01e10f73709a 100644
--- a/flang/test/Semantics/omp-do-cycle.f90
+++ b/flang/test/Semantics/omp-do-cycle.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! Check for cycle statements leaving an OpenMP structured block
 

diff  --git a/flang/test/Semantics/omp-do-ordered-positivecases.f90 b/flang/test/Semantics/omp-do-ordered-positivecases.f90
index bb571bb79daca..e2f9ec085f78b 100644
--- a/flang/test/Semantics/omp-do-ordered-positivecases.f90
+++ b/flang/test/Semantics/omp-do-ordered-positivecases.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Ordered Clause positive cases.
 

diff  --git a/flang/test/Semantics/omp-do-ordered.f90 b/flang/test/Semantics/omp-do-ordered.f90
index adcfa693caa7d..77a8476394970 100644
--- a/flang/test/Semantics/omp-do-ordered.f90
+++ b/flang/test/Semantics/omp-do-ordered.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Ordered Clause
 

diff  --git a/flang/test/Semantics/omp-do-schedule01.f90 b/flang/test/Semantics/omp-do-schedule01.f90
index f513e5f98f831..2c52f968eaef9 100644
--- a/flang/test/Semantics/omp-do-schedule01.f90
+++ b/flang/test/Semantics/omp-do-schedule01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Schedule Clause
 program omp_doSchedule

diff  --git a/flang/test/Semantics/omp-do-schedule02.f90 b/flang/test/Semantics/omp-do-schedule02.f90
index 6272f749ff13d..28f84d22e5eca 100644
--- a/flang/test/Semantics/omp-do-schedule02.f90
+++ b/flang/test/Semantics/omp-do-schedule02.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Schedule Clause
 program omp_doSchedule

diff  --git a/flang/test/Semantics/omp-do01.f90 b/flang/test/Semantics/omp-do01.f90
index deb0d506ef545..ee256c8a56861 100644
--- a/flang/test/Semantics/omp-do01.f90
+++ b/flang/test/Semantics/omp-do01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 ! The loop iteration variable may not appear in a firstprivate directive.

diff  --git a/flang/test/Semantics/omp-do03.f90 b/flang/test/Semantics/omp-do03.f90
index 67002e924dac8..f83cd7cb24ab6 100644
--- a/flang/test/Semantics/omp-do03.f90
+++ b/flang/test/Semantics/omp-do03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct

diff  --git a/flang/test/Semantics/omp-do04.f90 b/flang/test/Semantics/omp-do04.f90
index 41709dd6d2a3c..3ef7e7fb49525 100644
--- a/flang/test/Semantics/omp-do04.f90
+++ b/flang/test/Semantics/omp-do04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 ! The loop iteration variable may not appear in a threadprivate directive.

diff  --git a/flang/test/Semantics/omp-do05.f90 b/flang/test/Semantics/omp-do05.f90
index 3bf76707ddf35..a88d50bfea5f8 100644
--- a/flang/test/Semantics/omp-do05.f90
+++ b/flang/test/Semantics/omp-do05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct restrictions on single directive.
 

diff  --git a/flang/test/Semantics/omp-do06.f90 b/flang/test/Semantics/omp-do06.f90
index f39b0cd319255..1374e6357585c 100644
--- a/flang/test/Semantics/omp-do06.f90
+++ b/flang/test/Semantics/omp-do06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 ! The ordered clause must be present on the loop construct if any ordered

diff  --git a/flang/test/Semantics/omp-do08.f90 b/flang/test/Semantics/omp-do08.f90
index 65e94df67dea2..f4d6f7d88c76a 100644
--- a/flang/test/Semantics/omp-do08.f90
+++ b/flang/test/Semantics/omp-do08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 

diff  --git a/flang/test/Semantics/omp-do09.f90 b/flang/test/Semantics/omp-do09.f90
index 2c781da17693b..75b1ddcea66b0 100644
--- a/flang/test/Semantics/omp-do09.f90
+++ b/flang/test/Semantics/omp-do09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 ! The do-loop cannot be a DO WHILE or a DO loop without loop control.

diff  --git a/flang/test/Semantics/omp-do10.f90 b/flang/test/Semantics/omp-do10.f90
index 0c61de2b95900..d14278c5075e8 100644
--- a/flang/test/Semantics/omp-do10.f90
+++ b/flang/test/Semantics/omp-do10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 ! The DO loop iteration variable must be of type integer.

diff  --git a/flang/test/Semantics/omp-do13.f90 b/flang/test/Semantics/omp-do13.f90
index 6e3ac626360c5..2168375e95762 100644
--- a/flang/test/Semantics/omp-do13.f90
+++ b/flang/test/Semantics/omp-do13.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 

diff  --git a/flang/test/Semantics/omp-do15.f90 b/flang/test/Semantics/omp-do15.f90
index 4cdc2bd914718..10099d642720c 100644
--- a/flang/test/Semantics/omp-do15.f90
+++ b/flang/test/Semantics/omp-do15.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 

diff  --git a/flang/test/Semantics/omp-do16.f90 b/flang/test/Semantics/omp-do16.f90
index 2af5ed454cf93..f312ba61d23f3 100644
--- a/flang/test/Semantics/omp-do16.f90
+++ b/flang/test/Semantics/omp-do16.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.1 Loop Construct
 

diff  --git a/flang/test/Semantics/omp-firstprivate01.f90 b/flang/test/Semantics/omp-firstprivate01.f90
index c461cefb54a5f..507d16706c6ca 100644
--- a/flang/test/Semantics/omp-firstprivate01.f90
+++ b/flang/test/Semantics/omp-firstprivate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.4 firstprivate Clause
 ! Variables that appear in a firstprivate clause on a distribute or

diff  --git a/flang/test/Semantics/omp-flush01.f90 b/flang/test/Semantics/omp-flush01.f90
index 03b0268083187..1eb9680d8b047 100644
--- a/flang/test/Semantics/omp-flush01.f90
+++ b/flang/test/Semantics/omp-flush01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! 2.17.8 Flush construct [OpenMP 5.0]
 !        memory-order-clause ->

diff  --git a/flang/test/Semantics/omp-flush02.f90 b/flang/test/Semantics/omp-flush02.f90
index b9602def87253..a23f634a75a56 100644
--- a/flang/test/Semantics/omp-flush02.f90
+++ b/flang/test/Semantics/omp-flush02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 
 ! Check OpenMP 5.0 - 2.17.8 flush Construct
 ! Restriction -

diff  --git a/flang/test/Semantics/omp-lastprivate01.f90 b/flang/test/Semantics/omp-lastprivate01.f90
index e9a4be6730b82..104155529dbad 100644
--- a/flang/test/Semantics/omp-lastprivate01.f90
+++ b/flang/test/Semantics/omp-lastprivate01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.5 lastprivate Clause
 ! A variable that appears in a lastprivate clause must be definable.

diff  --git a/flang/test/Semantics/omp-lastprivate02.f90 b/flang/test/Semantics/omp-lastprivate02.f90
index b17031875884d..61e2329565659 100644
--- a/flang/test/Semantics/omp-lastprivate02.f90
+++ b/flang/test/Semantics/omp-lastprivate02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.5 lastprivate Clause
 ! A list item that is private within a parallel region, or that appears in

diff  --git a/flang/test/Semantics/omp-linear-iter.f90 b/flang/test/Semantics/omp-linear-iter.f90
index bb9dbcb4fae40..73389d953889f 100644
--- a/flang/test/Semantics/omp-linear-iter.f90
+++ b/flang/test/Semantics/omp-linear-iter.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! Various checks with the ordered construct
 

diff  --git a/flang/test/Semantics/omp-loop-association.f90 b/flang/test/Semantics/omp-loop-association.f90
index 5e7dce6241359..de7c9cbf0bc2f 100644
--- a/flang/test/Semantics/omp-loop-association.f90
+++ b/flang/test/Semantics/omp-loop-association.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! Check the association between OpenMPLoopConstruct and DoConstruct
 

diff  --git a/flang/test/Semantics/omp-loop-simd01.f90 b/flang/test/Semantics/omp-loop-simd01.f90
index 09d812a0403ee..0146a0193b127 100644
--- a/flang/test/Semantics/omp-loop-simd01.f90
+++ b/flang/test/Semantics/omp-loop-simd01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 4.5
 ! 2.8.3 Loop simd Construct

diff  --git a/flang/test/Semantics/omp-nested-barrier.f90 b/flang/test/Semantics/omp-nested-barrier.f90
index 63428b12f1c9f..14bc36d5e91af 100644
--- a/flang/test/Semantics/omp-nested-barrier.f90
+++ b/flang/test/Semantics/omp-nested-barrier.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! Various checks with the nesting of BARRIER construct
 

diff  --git a/flang/test/Semantics/omp-nested-cancel.f90 b/flang/test/Semantics/omp-nested-cancel.f90
index 579d762a02fac..97b3dd5fa8e90 100644
--- a/flang/test/Semantics/omp-nested-cancel.f90
+++ b/flang/test/Semantics/omp-nested-cancel.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 5.0
 ! Check OpenMP construct validity for the following directives:

diff  --git a/flang/test/Semantics/omp-nested-cancellation-point.f90 b/flang/test/Semantics/omp-nested-cancellation-point.f90
index a139bfae5d202..e339e8034e4b4 100644
--- a/flang/test/Semantics/omp-nested-cancellation-point.f90
+++ b/flang/test/Semantics/omp-nested-cancellation-point.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 5.0
 ! Check OpenMP construct validity for the following directives:

diff  --git a/flang/test/Semantics/omp-nested-distribute.f90 b/flang/test/Semantics/omp-nested-distribute.f90
index 92a121659f202..7baffdf07443e 100644
--- a/flang/test/Semantics/omp-nested-distribute.f90
+++ b/flang/test/Semantics/omp-nested-distribute.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! Check OpenMP clause validity for the following directives:
 !     2.10 Device constructs
 program main

diff  --git a/flang/test/Semantics/omp-nested-master.f90 b/flang/test/Semantics/omp-nested-master.f90
index 9debac680fc1e..0134674620ad4 100644
--- a/flang/test/Semantics/omp-nested-master.f90
+++ b/flang/test/Semantics/omp-nested-master.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! Various checks with the nesting of MASTER construct
 

diff  --git a/flang/test/Semantics/omp-nested-simd.f90 b/flang/test/Semantics/omp-nested-simd.f90
index bb1a219771a43..33d519097c80d 100644
--- a/flang/test/Semantics/omp-nested-simd.f90
+++ b/flang/test/Semantics/omp-nested-simd.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! Various checks with the nesting of SIMD construct
 

diff  --git a/flang/test/Semantics/omp-nested-target.f90 b/flang/test/Semantics/omp-nested-target.f90
index da4d1619f1063..ea061bddfe80a 100644
--- a/flang/test/Semantics/omp-nested-target.f90
+++ b/flang/test/Semantics/omp-nested-target.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 
 ! OpenMP Version 5.0
 ! Check OpenMP construct validity for the following directives:

diff  --git a/flang/test/Semantics/omp-nested-teams.f90 b/flang/test/Semantics/omp-nested-teams.f90
index 4a773b3b9454f..465ece4d2d92f 100644
--- a/flang/test/Semantics/omp-nested-teams.f90
+++ b/flang/test/Semantics/omp-nested-teams.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 5.0
 ! Check OpenMP construct validity for the following directives:

diff  --git a/flang/test/Semantics/omp-nested01.f90 b/flang/test/Semantics/omp-nested01.f90
index a24a99ff1a902..602790c24b1fc 100644
--- a/flang/test/Semantics/omp-nested01.f90
+++ b/flang/test/Semantics/omp-nested01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! Check OpenMP 2.17 Nesting of Regions
 

diff  --git a/flang/test/Semantics/omp-no-dowhile-in-parallel.f90 b/flang/test/Semantics/omp-no-dowhile-in-parallel.f90
index b5bf947a76a65..2cab4a4082796 100644
--- a/flang/test/Semantics/omp-no-dowhile-in-parallel.f90
+++ b/flang/test/Semantics/omp-no-dowhile-in-parallel.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 subroutine bug48308(x,i)
   real :: x(:)

diff  --git a/flang/test/Semantics/omp-ordered-simd.f90 b/flang/test/Semantics/omp-ordered-simd.f90
index 84ff7407e5c9d..3c544e97d9058 100644
--- a/flang/test/Semantics/omp-ordered-simd.f90
+++ b/flang/test/Semantics/omp-ordered-simd.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! Various checks with the ordered construct
 

diff  --git a/flang/test/Semantics/omp-parallel-private01.f90 b/flang/test/Semantics/omp-parallel-private01.f90
index 504b32250656a..6d851af876000 100644
--- a/flang/test/Semantics/omp-parallel-private01.f90
+++ b/flang/test/Semantics/omp-parallel-private01.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 parallel private Clause
 program omp_parallel_private

diff  --git a/flang/test/Semantics/omp-parallel-private02.f90 b/flang/test/Semantics/omp-parallel-private02.f90
index f1bfeb5fc1a16..aafd4933c829f 100644
--- a/flang/test/Semantics/omp-parallel-private02.f90
+++ b/flang/test/Semantics/omp-parallel-private02.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 parallel private Clause
 program omp_parallel_private

diff  --git a/flang/test/Semantics/omp-parallel-private03.f90 b/flang/test/Semantics/omp-parallel-private03.f90
index c76ce169f7f4e..2675b44f5358f 100644
--- a/flang/test/Semantics/omp-parallel-private03.f90
+++ b/flang/test/Semantics/omp-parallel-private03.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 parallel private Clause
 program omp_parallel_private

diff  --git a/flang/test/Semantics/omp-parallel-private04.f90 b/flang/test/Semantics/omp-parallel-private04.f90
index 1b4bed568f5ed..4448f289a46f4 100644
--- a/flang/test/Semantics/omp-parallel-private04.f90
+++ b/flang/test/Semantics/omp-parallel-private04.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 parallel private Clause
 program omp_parallel_private

diff  --git a/flang/test/Semantics/omp-parallel-shared01.f90 b/flang/test/Semantics/omp-parallel-shared01.f90
index e5e3004f5f4cb..291467833e82b 100644
--- a/flang/test/Semantics/omp-parallel-shared01.f90
+++ b/flang/test/Semantics/omp-parallel-shared01.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.2 parallel shared Clause
 program omp_parallel_shared

diff  --git a/flang/test/Semantics/omp-parallel-shared02.f90 b/flang/test/Semantics/omp-parallel-shared02.f90
index e91e47fbc87a2..f2eda036398a4 100644
--- a/flang/test/Semantics/omp-parallel-shared02.f90
+++ b/flang/test/Semantics/omp-parallel-shared02.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.2 parallel shared Clause
 program omp_parallel_shared

diff  --git a/flang/test/Semantics/omp-parallel-shared03.f90 b/flang/test/Semantics/omp-parallel-shared03.f90
index 48465f08422f5..8ae800de84ade 100644
--- a/flang/test/Semantics/omp-parallel-shared03.f90
+++ b/flang/test/Semantics/omp-parallel-shared03.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.2 parallel shared Clause
 program omp_parallel_shared

diff  --git a/flang/test/Semantics/omp-parallel-shared04.f90 b/flang/test/Semantics/omp-parallel-shared04.f90
index cb63e45cd5cf2..cd18a9e933c36 100644
--- a/flang/test/Semantics/omp-parallel-shared04.f90
+++ b/flang/test/Semantics/omp-parallel-shared04.f90
@@ -1,5 +1,4 @@
-!RUN: %S/test_errors.sh %s %t %flang -fopenmp
-!REQUIRES: shell
+!RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.2 parallel shared Clause
 program omp_parallel_shared

diff  --git a/flang/test/Semantics/omp-private01.f90 b/flang/test/Semantics/omp-private01.f90
index 32887def09e6d..e5cc4ba7bb395 100644
--- a/flang/test/Semantics/omp-private01.f90
+++ b/flang/test/Semantics/omp-private01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 private Clause
 ! Pointers with the INTENT(IN) attribute may not appear in a private clause.

diff  --git a/flang/test/Semantics/omp-private02.f90 b/flang/test/Semantics/omp-private02.f90
index db8c733cf9b36..fbc1da8ef92eb 100644
--- a/flang/test/Semantics/omp-private02.f90
+++ b/flang/test/Semantics/omp-private02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.3 private Clause
 ! Variables that appear in namelist statements may not appear in a private clause.

diff  --git a/flang/test/Semantics/omp-private03.f90 b/flang/test/Semantics/omp-private03.f90
index addca116a5b58..a0cf829bd5d26 100644
--- a/flang/test/Semantics/omp-private03.f90
+++ b/flang/test/Semantics/omp-private03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! Variables that appear in expressions for statement function definitions
 ! may not appear in private, firstprivate or lastprivate clauses.

diff  --git a/flang/test/Semantics/omp-reduction01.f90 b/flang/test/Semantics/omp-reduction01.f90
index b7793b9a3ae96..85e866922e1cd 100644
--- a/flang/test/Semantics/omp-reduction01.f90
+++ b/flang/test/Semantics/omp-reduction01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 program omp_reduction

diff  --git a/flang/test/Semantics/omp-reduction02.f90 b/flang/test/Semantics/omp-reduction02.f90
index 8cac4fb9f07c8..634381437a4e4 100644
--- a/flang/test/Semantics/omp-reduction02.f90
+++ b/flang/test/Semantics/omp-reduction02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 program omp_reduction

diff  --git a/flang/test/Semantics/omp-reduction03.f90 b/flang/test/Semantics/omp-reduction03.f90
index 0019d44fc1e18..77415790eccec 100644
--- a/flang/test/Semantics/omp-reduction03.f90
+++ b/flang/test/Semantics/omp-reduction03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 

diff  --git a/flang/test/Semantics/omp-reduction04.f90 b/flang/test/Semantics/omp-reduction04.f90
index 75ff094cff26f..0a8a306235857 100644
--- a/flang/test/Semantics/omp-reduction04.f90
+++ b/flang/test/Semantics/omp-reduction04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 program omp_Reduction

diff  --git a/flang/test/Semantics/omp-reduction05.f90 b/flang/test/Semantics/omp-reduction05.f90
index 1e1f7f13ead97..22810608e91f9 100644
--- a/flang/test/Semantics/omp-reduction05.f90
+++ b/flang/test/Semantics/omp-reduction05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 

diff  --git a/flang/test/Semantics/omp-reduction06.f90 b/flang/test/Semantics/omp-reduction06.f90
index 6b71bd620133f..50b17362d0e97 100644
--- a/flang/test/Semantics/omp-reduction06.f90
+++ b/flang/test/Semantics/omp-reduction06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 

diff  --git a/flang/test/Semantics/omp-reduction07.f90 b/flang/test/Semantics/omp-reduction07.f90
index e1f1d86d61366..74178a9f39ccb 100644
--- a/flang/test/Semantics/omp-reduction07.f90
+++ b/flang/test/Semantics/omp-reduction07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 program omp_reduction

diff  --git a/flang/test/Semantics/omp-reduction10.f90 b/flang/test/Semantics/omp-reduction10.f90
index 9c733dadbc655..96e0b50f81e86 100644
--- a/flang/test/Semantics/omp-reduction10.f90
+++ b/flang/test/Semantics/omp-reduction10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.15.3.6 Reduction Clause
 program omp_reduction

diff  --git a/flang/test/Semantics/omp-resolve01.f90 b/flang/test/Semantics/omp-resolve01.f90
index daa558265d72f..b716c4a6853b2 100644
--- a/flang/test/Semantics/omp-resolve01.f90
+++ b/flang/test/Semantics/omp-resolve01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -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 f16c51afdf37d..0bbf779ecde8f 100644
--- a/flang/test/Semantics/omp-resolve02.f90
+++ b/flang/test/Semantics/omp-resolve02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -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 6efb70d2d3d12..58fc4d57d929f 100644
--- a/flang/test/Semantics/omp-resolve03.f90
+++ b/flang/test/Semantics/omp-resolve03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -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 60822761bc810..147dc1ae7b945 100644
--- a/flang/test/Semantics/omp-resolve04.f90
+++ b/flang/test/Semantics/omp-resolve04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -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 580f8a14c81e3..a54feaec981de 100644
--- a/flang/test/Semantics/omp-resolve05.f90
+++ b/flang/test/Semantics/omp-resolve05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! 2.15.3 Data-Sharing Attribute Clauses
 ! 2.15.3.1 default Clause

diff  --git a/flang/test/Semantics/omp-resolve06.f90 b/flang/test/Semantics/omp-resolve06.f90
index 87191b659bdb5..4711b000c44d1 100644
--- a/flang/test/Semantics/omp-resolve06.f90
+++ b/flang/test/Semantics/omp-resolve06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 use omp_lib
 !2.11.4 Allocate Clause
 !For any list item that is specified in the allocate

diff  --git a/flang/test/Semantics/omp-sections01.f90 b/flang/test/Semantics/omp-sections01.f90
index 0a40337685ee0..4ea75931d91ca 100644
--- a/flang/test/Semantics/omp-sections01.f90
+++ b/flang/test/Semantics/omp-sections01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 4.5
 ! 2.7.2 sections Construct

diff  --git a/flang/test/Semantics/omp-simd-aligned.f90 b/flang/test/Semantics/omp-simd-aligned.f90
index f4424aa5c46e9..3870e21c844c1 100644
--- a/flang/test/Semantics/omp-simd-aligned.f90
+++ b/flang/test/Semantics/omp-simd-aligned.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 4.5
 ! 2.8.1 simd Construct

diff  --git a/flang/test/Semantics/omp-simd02.f90 b/flang/test/Semantics/omp-simd02.f90
index dcaed43fb2ffc..0ac71c655b41a 100644
--- a/flang/test/Semantics/omp-simd02.f90
+++ b/flang/test/Semantics/omp-simd02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 4.5
 ! 2.8.1 simd Construct

diff  --git a/flang/test/Semantics/omp-single01.f90 b/flang/test/Semantics/omp-single01.f90
index 07b827bba2b52..a12940902904a 100644
--- a/flang/test/Semantics/omp-single01.f90
+++ b/flang/test/Semantics/omp-single01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.3 single Construct
 ! Symbol present on multiple clauses

diff  --git a/flang/test/Semantics/omp-single02.f90 b/flang/test/Semantics/omp-single02.f90
index e39ce2538e3cd..cd80e7c2c74f5 100644
--- a/flang/test/Semantics/omp-single02.f90
+++ b/flang/test/Semantics/omp-single02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.3 single Construct
 ! Copyprivate variable is not thread private or private in outer context

diff  --git a/flang/test/Semantics/omp-taskgroup01.f90 b/flang/test/Semantics/omp-taskgroup01.f90
index c8de9f2271d08..c220c66287a5e 100644
--- a/flang/test/Semantics/omp-taskgroup01.f90
+++ b/flang/test/Semantics/omp-taskgroup01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 use omp_lib
   implicit none

diff  --git a/flang/test/Semantics/omp-taskloop-simd01.f90 b/flang/test/Semantics/omp-taskloop-simd01.f90
index 7cfa384ab2d49..e0ca7cfd8290d 100644
--- a/flang/test/Semantics/omp-taskloop-simd01.f90
+++ b/flang/test/Semantics/omp-taskloop-simd01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 
 ! OpenMP Version 5.0
 ! 2.10.3 taskloop simd Construct

diff  --git a/flang/test/Semantics/omp-taskloop01.f90 b/flang/test/Semantics/omp-taskloop01.f90
index 699d4c9087cd0..14be62e475aaf 100644
--- a/flang/test/Semantics/omp-taskloop01.f90
+++ b/flang/test/Semantics/omp-taskloop01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.9.2 taskloop Construct
 

diff  --git a/flang/test/Semantics/omp-workshare01.f90 b/flang/test/Semantics/omp-workshare01.f90
index 0b6a3a1cdf496..52d65bb5b2909 100644
--- a/flang/test/Semantics/omp-workshare01.f90
+++ b/flang/test/Semantics/omp-workshare01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.4 workshare Construct
 ! Invalid do construct inside !$omp workshare

diff  --git a/flang/test/Semantics/omp-workshare02.f90 b/flang/test/Semantics/omp-workshare02.f90
index 996c384303fb7..c53b323dcd8d1 100644
--- a/flang/test/Semantics/omp-workshare02.f90
+++ b/flang/test/Semantics/omp-workshare02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.4 workshare Construct
 ! The !omp workshare construct must not contain any user defined

diff  --git a/flang/test/Semantics/omp-workshare03.f90 b/flang/test/Semantics/omp-workshare03.f90
index 1c6e00d5d8321..e8e2241580d77 100644
--- a/flang/test/Semantics/omp-workshare03.f90
+++ b/flang/test/Semantics/omp-workshare03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.4 workshare Construct
 ! All array assignments, scalar assignments, and masked array assignments

diff  --git a/flang/test/Semantics/omp-workshare04.f90 b/flang/test/Semantics/omp-workshare04.f90
index 745dc9f4d49a6..0c1e2b1f6221a 100644
--- a/flang/test/Semantics/omp-workshare04.f90
+++ b/flang/test/Semantics/omp-workshare04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.4 workshare Construct
 ! Checks for OpenMP Workshare construct

diff  --git a/flang/test/Semantics/omp-workshare05.f90 b/flang/test/Semantics/omp-workshare05.f90
index 5f731193e45e3..70a8426bba4e6 100644
--- a/flang/test/Semantics/omp-workshare05.f90
+++ b/flang/test/Semantics/omp-workshare05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -fopenmp
 ! OpenMP Version 4.5
 ! 2.7.4 workshare Construct
 ! Checks for OpenMP Parallel constructs enclosed in Workshare constructs

diff  --git a/flang/test/Semantics/random-seed.f90 b/flang/test/Semantics/random-seed.f90
index defc0afda5449..20e3088c5e828 100644
--- a/flang/test/Semantics/random-seed.f90
+++ b/flang/test/Semantics/random-seed.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! NULL() intrinsic function error tests
 program test_random_seed
   integer :: size_arg

diff  --git a/flang/test/Semantics/reshape.f90 b/flang/test/Semantics/reshape.f90
index 4077e72209895..8113bffc577bb 100644
--- a/flang/test/Semantics/reshape.f90
+++ b/flang/test/Semantics/reshape.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 !Tests for RESHAPE
 program reshaper

diff  --git a/flang/test/Semantics/resolve01.f90 b/flang/test/Semantics/resolve01.f90
index 09066a2ab91a3..7a799940a8940 100644
--- a/flang/test/Semantics/resolve01.f90
+++ b/flang/test/Semantics/resolve01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 a66e8b59da2c6..3323866ca8c68 100644
--- a/flang/test/Semantics/resolve02.f90
+++ b/flang/test/Semantics/resolve02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 4fbc6164a71c4..25937796817b6 100644
--- a/flang/test/Semantics/resolve03.f90
+++ b/flang/test/Semantics/resolve03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 3bcd614811dc5..890a9016340d9 100644
--- a/flang/test/Semantics/resolve04.f90
+++ b/flang/test/Semantics/resolve04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 !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 34c88a7b7a73d..5c045aa99a591 100644
--- a/flang/test/Semantics/resolve05.f90
+++ b/flang/test/Semantics/resolve05.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 program p
   integer :: p ! this is ok
 end

diff  --git a/flang/test/Semantics/resolve06.f90 b/flang/test/Semantics/resolve06.f90
index b2a385b05b3fa..8c324a95f8b6d 100644
--- a/flang/test/Semantics/resolve06.f90
+++ b/flang/test/Semantics/resolve06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 implicit none
 allocatable :: x
 integer :: x

diff  --git a/flang/test/Semantics/resolve07.f90 b/flang/test/Semantics/resolve07.f90
index e5dda5b28c063..481094a51335f 100644
--- a/flang/test/Semantics/resolve07.f90
+++ b/flang/test/Semantics/resolve07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 2a7f68d07c9f6..b485f4c11bdf9 100644
--- a/flang/test/Semantics/resolve08.f90
+++ b/flang/test/Semantics/resolve08.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 c669b60471d7e..2954b146374da 100644
--- a/flang/test/Semantics/resolve09.f90
+++ b/flang/test/Semantics/resolve09.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 integer :: y
 procedure() :: a
 procedure(real) :: b

diff  --git a/flang/test/Semantics/resolve10.f90 b/flang/test/Semantics/resolve10.f90
index 740195d228ddc..4f2949b808a4f 100644
--- a/flang/test/Semantics/resolve10.f90
+++ b/flang/test/Semantics/resolve10.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   public
   type t

diff  --git a/flang/test/Semantics/resolve101.f90 b/flang/test/Semantics/resolve101.f90
index 359807e3155b3..b1c259e286b0c 100644
--- a/flang/test/Semantics/resolve101.f90
+++ b/flang/test/Semantics/resolve101.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Ensure that spurious errors do not arise from FinishSpecificationPart
 ! checking on a nested specification part.

diff  --git a/flang/test/Semantics/resolve102.f90 b/flang/test/Semantics/resolve102.f90
index 77b5e10369fe5..07f12d7b76839 100644
--- a/flang/test/Semantics/resolve102.f90
+++ b/flang/test/Semantics/resolve102.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Tests for circularly defined procedures
 !ERROR: Procedure 'sub' is recursively defined.  Procedures in the cycle: 'sub', 'p2'

diff  --git a/flang/test/Semantics/resolve104.f90 b/flang/test/Semantics/resolve104.f90
index 48fe9653c821e..3b5bea458db1d 100644
--- a/flang/test/Semantics/resolve104.f90
+++ b/flang/test/Semantics/resolve104.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test constant folding of type parameter values both a base value and a
 ! parameter name are supplied.
 ! 

diff  --git a/flang/test/Semantics/resolve105.f90 b/flang/test/Semantics/resolve105.f90
index 2e2feb8d80d5a..ab294d401349b 100644
--- a/flang/test/Semantics/resolve105.f90
+++ b/flang/test/Semantics/resolve105.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test instantiation of components that are procedure pointers.
 ! 
 program test

diff  --git a/flang/test/Semantics/resolve11.f90 b/flang/test/Semantics/resolve11.f90
index ec967279c12f1..2d93c63212af7 100644
--- a/flang/test/Semantics/resolve11.f90
+++ b/flang/test/Semantics/resolve11.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   public i
   integer, private :: j

diff  --git a/flang/test/Semantics/resolve12.f90 b/flang/test/Semantics/resolve12.f90
index a04d7e6dd1575..aa9dbd7f00603 100644
--- a/flang/test/Semantics/resolve12.f90
+++ b/flang/test/Semantics/resolve12.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
 end
 

diff  --git a/flang/test/Semantics/resolve13.f90 b/flang/test/Semantics/resolve13.f90
index a5647d0d417ab..1d7ec1af8f041 100644
--- a/flang/test/Semantics/resolve13.f90
+++ b/flang/test/Semantics/resolve13.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
   integer :: x
   integer, private :: y

diff  --git a/flang/test/Semantics/resolve14.f90 b/flang/test/Semantics/resolve14.f90
index c69b4d6681815..67cb5b2ab30fe 100644
--- a/flang/test/Semantics/resolve14.f90
+++ b/flang/test/Semantics/resolve14.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
   integer :: x
   integer :: y

diff  --git a/flang/test/Semantics/resolve15.f90 b/flang/test/Semantics/resolve15.f90
index f3bc8befd351f..3a2f3d78b5693 100644
--- a/flang/test/Semantics/resolve15.f90
+++ b/flang/test/Semantics/resolve15.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   real :: var
   interface i

diff  --git a/flang/test/Semantics/resolve16.f90 b/flang/test/Semantics/resolve16.f90
index 775af3876def7..d5725f67b35d7 100644
--- a/flang/test/Semantics/resolve16.f90
+++ b/flang/test/Semantics/resolve16.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   interface
     subroutine sub0

diff  --git a/flang/test/Semantics/resolve17.f90 b/flang/test/Semantics/resolve17.f90
index 064340d1b7617..96ab5cd11b461 100644
--- a/flang/test/Semantics/resolve17.f90
+++ b/flang/test/Semantics/resolve17.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 c917a68f92d24..1f59794b7e385 100644
--- a/flang/test/Semantics/resolve18.f90
+++ b/flang/test/Semantics/resolve18.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
   implicit none
 contains

diff  --git a/flang/test/Semantics/resolve19.f90 b/flang/test/Semantics/resolve19.f90
index 7f2252ef7e9b5..d3bd38dc9c6e5 100644
--- a/flang/test/Semantics/resolve19.f90
+++ b/flang/test/Semantics/resolve19.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   interface a
     subroutine s(x)

diff  --git a/flang/test/Semantics/resolve20.f90 b/flang/test/Semantics/resolve20.f90
index 6908aeb575a58..4d1c6381bb56f 100644
--- a/flang/test/Semantics/resolve20.f90
+++ b/flang/test/Semantics/resolve20.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   abstract interface
     subroutine foo

diff  --git a/flang/test/Semantics/resolve21.f90 b/flang/test/Semantics/resolve21.f90
index bee368c4e669a..3be7602b539d2 100644
--- a/flang/test/Semantics/resolve21.f90
+++ b/flang/test/Semantics/resolve21.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1
   type :: t
     integer :: i

diff  --git a/flang/test/Semantics/resolve22.f90 b/flang/test/Semantics/resolve22.f90
index c35f0574fce97..6f2d00958d372 100644
--- a/flang/test/Semantics/resolve22.f90
+++ b/flang/test/Semantics/resolve22.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 8a876b0b1d8ad..5bb2691abbe00 100644
--- a/flang/test/Semantics/resolve23.f90
+++ b/flang/test/Semantics/resolve23.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   type :: t
     real :: y

diff  --git a/flang/test/Semantics/resolve24.f90 b/flang/test/Semantics/resolve24.f90
index c6306fbea5944..0b61a50065ded 100644
--- a/flang/test/Semantics/resolve24.f90
+++ b/flang/test/Semantics/resolve24.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 e3fd2c267b4aa..9e717d50cd9a6 100644
--- a/flang/test/Semantics/resolve25.f90
+++ b/flang/test/Semantics/resolve25.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   interface foo
     real function s1(x)

diff  --git a/flang/test/Semantics/resolve26.f90 b/flang/test/Semantics/resolve26.f90
index 96c7eef1df5b7..5e77cc4fbe9a5 100644
--- a/flang/test/Semantics/resolve26.f90
+++ b/flang/test/Semantics/resolve26.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
   interface
     module subroutine s()

diff  --git a/flang/test/Semantics/resolve27.f90 b/flang/test/Semantics/resolve27.f90
index 83ad4081881c1..cda39ea4aee21 100644
--- a/flang/test/Semantics/resolve27.f90
+++ b/flang/test/Semantics/resolve27.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   interface
     module subroutine s()

diff  --git a/flang/test/Semantics/resolve28.f90 b/flang/test/Semantics/resolve28.f90
index 2b5cc2fe5842d..d04e60aaf4f5c 100644
--- a/flang/test/Semantics/resolve28.f90
+++ b/flang/test/Semantics/resolve28.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s
   type t
   end type

diff  --git a/flang/test/Semantics/resolve29.f90 b/flang/test/Semantics/resolve29.f90
index 96ec9d7b7a59d..9e97569117ef8 100644
--- a/flang/test/Semantics/resolve29.f90
+++ b/flang/test/Semantics/resolve29.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   type t1
   end type

diff  --git a/flang/test/Semantics/resolve30.f90 b/flang/test/Semantics/resolve30.f90
index f34ad5f3bbeea..c594cceef15b1 100644
--- a/flang/test/Semantics/resolve30.f90
+++ b/flang/test/Semantics/resolve30.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1
   integer x
   block

diff  --git a/flang/test/Semantics/resolve31.f90 b/flang/test/Semantics/resolve31.f90
index b99d081b7c900..57fa5e028b325 100644
--- a/flang/test/Semantics/resolve31.f90
+++ b/flang/test/Semantics/resolve31.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 542cd7e734c78..060b29ec40b5a 100644
--- a/flang/test/Semantics/resolve32.f90
+++ b/flang/test/Semantics/resolve32.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m2
   public s2, s4
   private s3

diff  --git a/flang/test/Semantics/resolve33.f90 b/flang/test/Semantics/resolve33.f90
index 114479294c9da..4b27a8d231f52 100644
--- a/flang/test/Semantics/resolve33.f90
+++ b/flang/test/Semantics/resolve33.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 9d816e5cfa0e1..e0c61689d7d0a 100644
--- a/flang/test/Semantics/resolve34.f90
+++ b/flang/test/Semantics/resolve34.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Extended derived types
 
 module m1

diff  --git a/flang/test/Semantics/resolve35.f90 b/flang/test/Semantics/resolve35.f90
index bbefe2791a49a..1dcfd068b6e70 100644
--- a/flang/test/Semantics/resolve35.f90
+++ b/flang/test/Semantics/resolve35.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Construct names
 
 subroutine s1

diff  --git a/flang/test/Semantics/resolve36.f90 b/flang/test/Semantics/resolve36.f90
index ac8595c2deff9..bdb1b227f61ce 100644
--- a/flang/test/Semantics/resolve36.f90
+++ b/flang/test/Semantics/resolve36.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! 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 19c09fb9ba12f..bd94e120d4867 100644
--- a/flang/test/Semantics/resolve37.f90
+++ b/flang/test/Semantics/resolve37.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 44f5f771d6298..d1612ebdbb158 100644
--- a/flang/test/Semantics/resolve38.f90
+++ b/flang/test/Semantics/resolve38.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! C772
 module m1
   type t1

diff  --git a/flang/test/Semantics/resolve39.f90 b/flang/test/Semantics/resolve39.f90
index 6f27ab22e2ceb..b456b3ff93d01 100644
--- a/flang/test/Semantics/resolve39.f90
+++ b/flang/test/Semantics/resolve39.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1
   implicit none
   real(8) :: x = 2.0

diff  --git a/flang/test/Semantics/resolve40.f90 b/flang/test/Semantics/resolve40.f90
index 32d247df4db8b..331c5ebd02c0e 100644
--- a/flang/test/Semantics/resolve40.f90
+++ b/flang/test/Semantics/resolve40.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1
   namelist /nl/x
   block

diff  --git a/flang/test/Semantics/resolve41.f90 b/flang/test/Semantics/resolve41.f90
index 15eb1b95fa924..d2a991c0a52dc 100644
--- a/flang/test/Semantics/resolve41.f90
+++ b/flang/test/Semantics/resolve41.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
   implicit none
   real, parameter :: a = 8.0

diff  --git a/flang/test/Semantics/resolve42.f90 b/flang/test/Semantics/resolve42.f90
index 6138a3ebdc530..a807d80cd2316 100644
--- a/flang/test/Semantics/resolve42.f90
+++ b/flang/test/Semantics/resolve42.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 27677de89d004..5555f5e0709e4 100644
--- a/flang/test/Semantics/resolve43.f90
+++ b/flang/test/Semantics/resolve43.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 34c4d815cbcdf..a251840d43df6 100644
--- a/flang/test/Semantics/resolve44.f90
+++ b/flang/test/Semantics/resolve44.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 fb9ef37e628f4..b3a09d2434773 100644
--- a/flang/test/Semantics/resolve45.f90
+++ b/flang/test/Semantics/resolve45.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 c762435d63ab8..716d72f835767 100644
--- a/flang/test/Semantics/resolve46.f90
+++ b/flang/test/Semantics/resolve46.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 339fc6126fccd..b839cf9c5019d 100644
--- a/flang/test/Semantics/resolve47.f90
+++ b/flang/test/Semantics/resolve47.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 66e1eaabb12be..e4e35c7531cbf 100644
--- a/flang/test/Semantics/resolve48.f90
+++ b/flang/test/Semantics/resolve48.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 424f99ac2440e..8a6a09b0d3848 100644
--- a/flang/test/Semantics/resolve49.f90
+++ b/flang/test/Semantics/resolve49.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test section subscript
 program p1
   real :: a(10,10)

diff  --git a/flang/test/Semantics/resolve50.f90 b/flang/test/Semantics/resolve50.f90
index a23cd195aa010..cc4dc030a9905 100644
--- a/flang/test/Semantics/resolve50.f90
+++ b/flang/test/Semantics/resolve50.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test coarray association in CHANGE TEAM statement
 
 subroutine s1

diff  --git a/flang/test/Semantics/resolve51.f90 b/flang/test/Semantics/resolve51.f90
index 4e8ab5ea3c496..232d8bc576386 100644
--- a/flang/test/Semantics/resolve51.f90
+++ b/flang/test/Semantics/resolve51.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test SELECT TYPE errors: C1157
 
 subroutine s1()

diff  --git a/flang/test/Semantics/resolve52.f90 b/flang/test/Semantics/resolve52.f90
index c69fa68f874c2..c9ee0b8620899 100644
--- a/flang/test/Semantics/resolve52.f90
+++ b/flang/test/Semantics/resolve52.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 357a9d067c7ba..d871848afe8b7 100644
--- a/flang/test/Semantics/resolve53.f90
+++ b/flang/test/Semantics/resolve53.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 bb53d056811f1..8f48e3fe7dc33 100644
--- a/flang/test/Semantics/resolve54.f90
+++ b/flang/test/Semantics/resolve54.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 b66099dc1dfb1..1133e791fa389 100644
--- a/flang/test/Semantics/resolve55.f90
+++ b/flang/test/Semantics/resolve55.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 0de93ef6c4567..e92a43d414afd 100644
--- a/flang/test/Semantics/resolve56.f90
+++ b/flang/test/Semantics/resolve56.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2b917b81fe206..526bdc5638722 100644
--- a/flang/test/Semantics/resolve57.f90
+++ b/flang/test/Semantics/resolve57.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 744437992f72d..447e14ae80a97 100644
--- a/flang/test/Semantics/resolve58.f90
+++ b/flang/test/Semantics/resolve58.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 09085fa221ffb..0eeb1170fb3d7 100644
--- a/flang/test/Semantics/resolve59.f90
+++ b/flang/test/Semantics/resolve59.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 336d8e91c057b..bf81db67d4888 100644
--- a/flang/test/Semantics/resolve60.f90
+++ b/flang/test/Semantics/resolve60.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Testing 7.6 enum
 
   ! OK

diff  --git a/flang/test/Semantics/resolve61.f90 b/flang/test/Semantics/resolve61.f90
index 031aee29e9816..7fa79987ab109 100644
--- a/flang/test/Semantics/resolve61.f90
+++ b/flang/test/Semantics/resolve61.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 7de82d401f77e..ef565dd01d6c5 100644
--- a/flang/test/Semantics/resolve62.f90
+++ b/flang/test/Semantics/resolve62.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2d38e90d6175b..adc3010c6d43d 100644
--- a/flang/test/Semantics/resolve63.f90
+++ b/flang/test/Semantics/resolve63.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 40d16ce27980e..5a6bdc158a13c 100644
--- a/flang/test/Semantics/resolve64.f90
+++ b/flang/test/Semantics/resolve64.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang -flogical-abbreviations -fxor-operator
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang -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 701c53a17cd3c..d1fb26ddaaecd 100644
--- a/flang/test/Semantics/resolve65.f90
+++ b/flang/test/Semantics/resolve65.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 7474f7fb6c055..acc4701e01fe5 100644
--- a/flang/test/Semantics/resolve66.f90
+++ b/flang/test/Semantics/resolve66.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2c554af29c8c7..6ecc738879bf0 100644
--- a/flang/test/Semantics/resolve67.f90
+++ b/flang/test/Semantics/resolve67.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 a88ab007f8382..0221fbc41cfb4 100644
--- a/flang/test/Semantics/resolve68.f90
+++ b/flang/test/Semantics/resolve68.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test resolution of type-bound generics.
 
 module m1

diff  --git a/flang/test/Semantics/resolve69.f90 b/flang/test/Semantics/resolve69.f90
index f6ce5c70d1e70..e3f00e2bb27ac 100644
--- a/flang/test/Semantics/resolve69.f90
+++ b/flang/test/Semantics/resolve69.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 60c488d4b52ac..b01469cb69c24 100644
--- a/flang/test/Semantics/resolve70.f90
+++ b/flang/test/Semantics/resolve70.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 5bdbbda306ab4..51e8f07ae7057 100644
--- a/flang/test/Semantics/resolve71.f90
+++ b/flang/test/Semantics/resolve71.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 6f70e9ae256d7..cf0d54aef9fca 100644
--- a/flang/test/Semantics/resolve72.f90
+++ b/flang/test/Semantics/resolve72.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 90656966d4b17..1ec9f09c44be7 100644
--- a/flang/test/Semantics/resolve73.f90
+++ b/flang/test/Semantics/resolve73.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 12be78fc08c57..14d1c8a29b867 100644
--- a/flang/test/Semantics/resolve74.f90
+++ b/flang/test/Semantics/resolve74.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 23269030653ea..b0d9072d56580 100644
--- a/flang/test/Semantics/resolve75.f90
+++ b/flang/test/Semantics/resolve75.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 2e594aa728e64..6b182d1d57906 100644
--- a/flang/test/Semantics/resolve76.f90
+++ b/flang/test/Semantics/resolve76.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! 15.6.2.5(3)
 

diff  --git a/flang/test/Semantics/resolve77.f90 b/flang/test/Semantics/resolve77.f90
index 3c413848a3baa..d762781acdac4 100644
--- a/flang/test/Semantics/resolve77.f90
+++ b/flang/test/Semantics/resolve77.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 296c198b19873..8c25f32e80cdc 100644
--- a/flang/test/Semantics/resolve78.f90
+++ b/flang/test/Semantics/resolve78.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 8f828fcbe8b86..037e107dc5874 100644
--- a/flang/test/Semantics/resolve79.f90
+++ b/flang/test/Semantics/resolve79.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 dcc544f117c2f..e787a4ba7f866 100644
--- a/flang/test/Semantics/resolve80.f90
+++ b/flang/test/Semantics/resolve80.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 cd74e100e4965..2a0b961d48e5c 100644
--- a/flang/test/Semantics/resolve81.f90
+++ b/flang/test/Semantics/resolve81.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 461bd3c9a0abd..ef216abd23dbc 100644
--- a/flang/test/Semantics/resolve82.f90
+++ b/flang/test/Semantics/resolve82.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 8d28f7f25b3ae..fc18f28415214 100644
--- a/flang/test/Semantics/resolve83.f90
+++ b/flang/test/Semantics/resolve83.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m
 
   ! For C1543

diff  --git a/flang/test/Semantics/resolve84.f90 b/flang/test/Semantics/resolve84.f90
index 6a7ff3ed4e968..8562a0c1a423f 100644
--- a/flang/test/Semantics/resolve84.f90
+++ b/flang/test/Semantics/resolve84.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 c1817b9ae6599..d1720bd5aef8a 100644
--- a/flang/test/Semantics/resolve85.f90
+++ b/flang/test/Semantics/resolve85.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 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 c4950b40fcf52..15969c74b6ef9 100644
--- a/flang/test/Semantics/resolve86.f90
+++ b/flang/test/Semantics/resolve86.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 abdc388dd9c44..5275e6fd3587c 100644
--- a/flang/test/Semantics/resolve87.f90
+++ b/flang/test/Semantics/resolve87.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 a0cb96bf0d6bf..c02561ffa29b6 100644
--- a/flang/test/Semantics/resolve88.f90
+++ b/flang/test/Semantics/resolve88.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 f37ce1ed9513d..a15e54578589c 100644
--- a/flang/test/Semantics/resolve89.f90
+++ b/flang/test/Semantics/resolve89.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/resolve90.f90 b/flang/test/Semantics/resolve90.f90
index c0aa420e59eb2..12467341a97e6 100644
--- a/flang/test/Semantics/resolve90.f90
+++ b/flang/test/Semantics/resolve90.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Testing for pointer constant, along with :
 ! C751 A component shall not have both the ALLOCATABLE and POINTER attributes.
 ! C752 If the CONTIGUOUS attribute is specified, the component shall be an 

diff  --git a/flang/test/Semantics/resolve91.f90 b/flang/test/Semantics/resolve91.f90
index 44b1dc5e33300..f458823bc5435 100644
--- a/flang/test/Semantics/resolve91.f90
+++ b/flang/test/Semantics/resolve91.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests for duplicate definitions and initializations, mostly of procedures
 module m
   procedure(real), pointer :: p

diff  --git a/flang/test/Semantics/resolve92.f90 b/flang/test/Semantics/resolve92.f90
index 4b7e7955471bf..a149454dd381f 100644
--- a/flang/test/Semantics/resolve92.f90
+++ b/flang/test/Semantics/resolve92.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 module m1
   implicit none

diff  --git a/flang/test/Semantics/resolve93.f90 b/flang/test/Semantics/resolve93.f90
index 5454267136dfc..71e0e40a2a230 100644
--- a/flang/test/Semantics/resolve93.f90
+++ b/flang/test/Semantics/resolve93.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 subroutine s1()
   character(10) str
   character(10) str1

diff  --git a/flang/test/Semantics/resolve94.f90 b/flang/test/Semantics/resolve94.f90
index bec63f3db722f..e47ab4a433829 100644
--- a/flang/test/Semantics/resolve94.f90
+++ b/flang/test/Semantics/resolve94.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! C929   No specifier shall appear more than once in a given 
 !   image-selector-spec-list.
 ! C930 TEAM and TEAM_NUMBER shall not both appear in the same

diff  --git a/flang/test/Semantics/resolve95.f90 b/flang/test/Semantics/resolve95.f90
index 38103c34c3b54..b3ddb2db470b6 100644
--- a/flang/test/Semantics/resolve95.f90
+++ b/flang/test/Semantics/resolve95.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test SELECT TYPE and ASSOCIATE errors: C1103
 
 subroutine s1()

diff  --git a/flang/test/Semantics/resolve96.f90 b/flang/test/Semantics/resolve96.f90
index 6cb61804e12be..680d6b7bee55b 100644
--- a/flang/test/Semantics/resolve96.f90
+++ b/flang/test/Semantics/resolve96.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Check distinguishability for specific procedures of defined operators and
 ! assignment. These are 
diff erent from names because there a normal generic

diff  --git a/flang/test/Semantics/resolve97.f90 b/flang/test/Semantics/resolve97.f90
index fff143e9e1c13..f9f545ef59fe4 100644
--- a/flang/test/Semantics/resolve97.f90
+++ b/flang/test/Semantics/resolve97.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! Check errors from illegal (10.1.12 para 2) forward references
 ! in specification expressions to entities declared later in the

diff  --git a/flang/test/Semantics/resolve98.f90 b/flang/test/Semantics/resolve98.f90
index c5fe44125549b..108bfdaed066e 100644
--- a/flang/test/Semantics/resolve98.f90
+++ b/flang/test/Semantics/resolve98.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Errors when comparing LOGICAL operands
 
 program testCompare

diff  --git a/flang/test/Semantics/resolve99.f90 b/flang/test/Semantics/resolve99.f90
index ae10d563f9595..a2dd41cefd0e2 100644
--- a/flang/test/Semantics/resolve99.f90
+++ b/flang/test/Semantics/resolve99.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests for the index-name of a FORALL statement
 
 module m1

diff  --git a/flang/test/Semantics/save01.f90 b/flang/test/Semantics/save01.f90
index beffcc98cc55e..2d435af027b1c 100644
--- a/flang/test/Semantics/save01.f90
+++ b/flang/test/Semantics/save01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 MODULE test
 SAVE
 CONTAINS

diff  --git a/flang/test/Semantics/select-rank.f90 b/flang/test/Semantics/select-rank.f90
index 60582876e5ab5..d0cd93195501f 100644
--- a/flang/test/Semantics/select-rank.f90
+++ b/flang/test/Semantics/select-rank.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 !Tests for SELECT RANK Construct(R1148)
 program select_rank

diff  --git a/flang/test/Semantics/select-rank02.f90 b/flang/test/Semantics/select-rank02.f90
index acf789c696410..b39a75c84cb50 100644
--- a/flang/test/Semantics/select-rank02.f90
+++ b/flang/test/Semantics/select-rank02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 !Shape analysis related tests for SELECT RANK Construct(R1148)
 program select_rank

diff  --git a/flang/test/Semantics/selecttype01.f90 b/flang/test/Semantics/selecttype01.f90
index a564bd8c373e1..62b3504b50873 100644
--- a/flang/test/Semantics/selecttype01.f90
+++ b/flang/test/Semantics/selecttype01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test for checking select type constraints,
 module m1
   use ISO_C_BINDING

diff  --git a/flang/test/Semantics/selecttype02.f90 b/flang/test/Semantics/selecttype02.f90
index 309425013a779..54127c0aeec46 100644
--- a/flang/test/Semantics/selecttype02.f90
+++ b/flang/test/Semantics/selecttype02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 module m1
   use ISO_C_BINDING
   type shape

diff  --git a/flang/test/Semantics/selecttype03.f90 b/flang/test/Semantics/selecttype03.f90
index c4f4143eb087d..73274e214e47d 100644
--- a/flang/test/Semantics/selecttype03.f90
+++ b/flang/test/Semantics/selecttype03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test various conditions in C1158.
 implicit none
 

diff  --git a/flang/test/Semantics/separate-mp01.f90 b/flang/test/Semantics/separate-mp01.f90
index 03b27e1d7b23a..27bf2a2f0ca0c 100644
--- a/flang/test/Semantics/separate-mp01.f90
+++ b/flang/test/Semantics/separate-mp01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! 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 2c0ac61e9134a..576a3b4825d75 100644
--- a/flang/test/Semantics/separate-mp02.f90
+++ b/flang/test/Semantics/separate-mp02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 
 ! 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/shape.f90 b/flang/test/Semantics/shape.f90
index 00c7bfd46820b..f43b81f2b44dc 100644
--- a/flang/test/Semantics/shape.f90
+++ b/flang/test/Semantics/shape.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Test comparisons that use the intrinsic SHAPE() as an operand
 program testShape
 contains

diff  --git a/flang/test/Semantics/spec-expr.f90 b/flang/test/Semantics/spec-expr.f90
index c88483a7c5cf4..41e82d708bb89 100644
--- a/flang/test/Semantics/spec-expr.f90
+++ b/flang/test/Semantics/spec-expr.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! Tests for the 14 items that specify a "specification expression" in section
 ! 10.1.11
 

diff  --git a/flang/test/Semantics/stop01.f90 b/flang/test/Semantics/stop01.f90
index 540cec54f8f12..cf7b0056b9b92 100644
--- a/flang/test/Semantics/stop01.f90
+++ b/flang/test/Semantics/stop01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 program main
   implicit none
   integer :: i = -1

diff  --git a/flang/test/Semantics/structconst01.f90 b/flang/test/Semantics/structconst01.f90
index c225d26a65c23..bdf400c777a97 100644
--- a/flang/test/Semantics/structconst01.f90
+++ b/flang/test/Semantics/structconst01.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 ff523c28c7a29..c3494b2e2261c 100644
--- a/flang/test/Semantics/structconst02.f90
+++ b/flang/test/Semantics/structconst02.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 70694f03ad022..64fc500b555a1 100644
--- a/flang/test/Semantics/structconst03.f90
+++ b/flang/test/Semantics/structconst03.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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 728a4c74d28be..5a168fa72b689 100644
--- a/flang/test/Semantics/structconst04.f90
+++ b/flang/test/Semantics/structconst04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! 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/test_errors.py b/flang/test/Semantics/test_errors.py
new file mode 100755
index 0000000000000..ce176e270f5d0
--- /dev/null
+++ b/flang/test/Semantics/test_errors.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+"""Compiles a source file and checks errors against those listed in the file.
+
+Parameters:
+    sys.argv[1]: a source file with contains the input and expected output
+    sys.argv[2]: the Flang frontend driver
+    sys.argv[3:]: Optional arguments to the Flang frontend driver"""
+
+import sys
+import re
+import tempfile
+import subprocess
+import common as cm
+
+from 
diff lib import unified_
diff 
+
+cm.check_args(sys.argv)
+srcdir = cm.set_source(sys.argv[1])
+with open(srcdir, 'r') as f:
+    src = f.readlines()
+actual = ""
+expect = ""
+
diff s = ""
+log = ""
+
+flang_fc1 = cm.set_executable(sys.argv[2])
+flang_fc1_args = sys.argv[3:]
+flang_fc1_options = "-fsyntax-only"
+
+# Compiles, and reads in the output from the compilation process
+cmd = [flang_fc1, *flang_fc1_args, flang_fc1_options, str(srcdir)]
+with tempfile.TemporaryDirectory() as tmpdir:
+    try:
+        proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                              check=True, universal_newlines=True, cwd=tmpdir)
+    except subprocess.CalledProcessError as e:
+        log = e.stderr
+        if e.returncode >= 128:
+            print(f"{log}")
+            sys.exit(1)
+
+# Cleans up the output from the compilation process to be easier to process
+for line in log.split('\n'):
+    m = re.search(r"[^:]*:(\d+:).*(?:error:)(.*)", line)
+    if m:
+        actual += m.expand(r"\1\2\n")
+
+# Gets the expected errors and their line number
+errors = []
+for i, line in enumerate(src, 1):
+    m = re.search(r"(?:^\s*!ERROR: )(.*)", line)
+    if m:
+        errors.append(m.group(1))
+        continue
+    if errors:
+        for x in errors:
+            expect += f"{i}: {x}\n"
+        errors = []
+
+# Compares the expected errors with the compiler errors
+for line in unified_
diff (actual.split("\n"), expect.split("\n"), n=0):
+    line = re.sub(r"(^\-)(\d+:)", r"\nactual at \g<2>", line)
+    line = re.sub(r"(^\+)(\d+:)", r"\nexpect at \g<2>", line)
+    
diff s += line
+
+if 
diff s != "":
+    print(
diff s)
+    print()
+    print("FAIL")
+    sys.exit(1)
+else:
+    print()
+    print("PASS")
+

diff  --git a/flang/test/Semantics/test_errors.sh b/flang/test/Semantics/test_errors.sh
deleted file mode 100755
index 20486b3abebaa..0000000000000
--- a/flang/test/Semantics/test_errors.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bash
-# Compile a source file and check errors against those listed in the file.
-# Change the compiler by setting the FLANG_FC1 environment variable.
-
-FLANG_FC1_OPTIONS="-fsyntax-only"
-srcdir=$(dirname $0)
-source $srcdir/common.sh
-[[ ! -f $src ]] && die "File not found: $src"
-
-log=$temp/log
-actual=$temp/actual
-expect=$temp/expect
-
diff s=$temp/
diff s
-
-cmd="$FLANG_FC1 $FLANG_FC1_OPTIONS $src"
-( cd $temp; $cmd ) > $log 2>&1
-if [[ $? -ge 128 ]]; then
-  cat $log
-  exit 1
-fi
-
-# $actual has errors from the compiler; $expect has them from !ERROR comments in source
-# Format both as "<line>: <text>" so they can be 
diff ed.
-sed -n 's=^[^:]*:\([^:]*\):[^:]*: error: =\1: =p' $log > $actual
-awk '
-  BEGIN { FS = "!ERROR: "; }
-  /^ *!ERROR: / { errors[nerrors++] = $2; next; }
-  { for (i = 0; i < nerrors; ++i) printf "%d: %s\n", NR, errors[i]; nerrors = 0; }
-' $src > $expect
-
-if 
diff  -U0 $actual $expect > $
diff s; then
-  echo PASS
-else
-  echo "$cmd"
-  < $
diff s \
-    sed -n -e 's/^-\([0-9]\)/actual at \1/p' -e 's/^+\([0-9]\)/expect at \1/p' \
-    | sort -n -k 3
-  die FAIL
-fi

diff  --git a/flang/test/Semantics/unpack.f90 b/flang/test/Semantics/unpack.f90
index 71bd21c7fb008..32c313dc0ae6f 100644
--- a/flang/test/Semantics/unpack.f90
+++ b/flang/test/Semantics/unpack.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_errors.sh %s %t %flang_fc1
-! REQUIRES: shell
+! RUN: %python %S/test_errors.py %s %flang_fc1
 ! UNPACK() intrinsic function error tests
 program test_unpack
   integer, dimension(2) :: vector = [343, 512]


        


More information about the flang-commits mailing list