From 5463446ddca02d121c971387f930cad8b7d96553 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 4 Dec 2024 18:03:22 +0000 Subject: [PATCH 1/2] Always pass NO_STOP_MESSAGE to Fortran tests Currently out of the box the Fortran tests fail with flang because the NO_STOP_MESSAGE environment variable needs to be set for them to pass. This environment variable should therefore always be set for the tests so that they can pass out of the box. --- Fortran/CMakeLists.txt | 2 ++ Fortran/UnitTests/fcvs21_f95/lit.local.cfg | 6 ------ Fortran/UnitTests/finalization/lit.local.cfg | 6 ------ Fortran/lit.local.cfg | 4 ++++ 4 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 Fortran/lit.local.cfg diff --git a/Fortran/CMakeLists.txt b/Fortran/CMakeLists.txt index 715dd162c0..f2ff418823 100644 --- a/Fortran/CMakeLists.txt +++ b/Fortran/CMakeLists.txt @@ -17,3 +17,5 @@ if (NOT WIN32 AND NOT APPLE) add_subdirectory(gfortran) endif() endif() + +file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Fortran/UnitTests/fcvs21_f95/lit.local.cfg b/Fortran/UnitTests/fcvs21_f95/lit.local.cfg index bd1b4db1aa..1166820260 100644 --- a/Fortran/UnitTests/fcvs21_f95/lit.local.cfg +++ b/Fortran/UnitTests/fcvs21_f95/lit.local.cfg @@ -1,8 +1,2 @@ config.traditional_output = True config.single_source = True - -# Flang uses NO_STOP_MESSAGE to control the output of the STOP statement. If -# it is present in the environment, we should forward it to the tests, otherwise -# they might choke on warnings about signaling INEXACT exceptions. -if "NO_STOP_MESSAGE" in os.environ: - config.environment["NO_STOP_MESSAGE"] = os.environ["NO_STOP_MESSAGE"] diff --git a/Fortran/UnitTests/finalization/lit.local.cfg b/Fortran/UnitTests/finalization/lit.local.cfg index bd1b4db1aa..1166820260 100644 --- a/Fortran/UnitTests/finalization/lit.local.cfg +++ b/Fortran/UnitTests/finalization/lit.local.cfg @@ -1,8 +1,2 @@ config.traditional_output = True config.single_source = True - -# Flang uses NO_STOP_MESSAGE to control the output of the STOP statement. If -# it is present in the environment, we should forward it to the tests, otherwise -# they might choke on warnings about signaling INEXACT exceptions. -if "NO_STOP_MESSAGE" in os.environ: - config.environment["NO_STOP_MESSAGE"] = os.environ["NO_STOP_MESSAGE"] diff --git a/Fortran/lit.local.cfg b/Fortran/lit.local.cfg new file mode 100644 index 0000000000..d5b11eccd0 --- /dev/null +++ b/Fortran/lit.local.cfg @@ -0,0 +1,4 @@ +# Flang uses NO_STOP_MESSAGE to control the output of the STOP statement. +# We should set it for running the tests, otherwise they might choke on warnings +# about signaling INEXACT exceptions. +config.environment["NO_STOP_MESSAGE"] = "1" From 7693e51e41132c6fabc5c1e1407ed4e93c2f0069 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 18 Dec 2024 07:05:52 +0000 Subject: [PATCH 2/2] Add Readme with documentation of the change --- Fortran/Readme.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Fortran/Readme.txt diff --git a/Fortran/Readme.txt b/Fortran/Readme.txt new file mode 100644 index 0000000000..33488b29e4 --- /dev/null +++ b/Fortran/Readme.txt @@ -0,0 +1,5 @@ +By default LLVM flang prints a stop message in certain circumstances that +breaks some of the tests in this directory. As such we add the environment +variable NO_STOP_MESSAGE=1 to disable this behaviour. If we wish to add tests +in future that need to check the stop message, those can be added in a +subdirectory with a lit.local.cfg that unsets this environment variable.