Skip to content

Commit 9fb1916

Browse files
committed
Reland "[test-suite] Disable Fortran FM509 test when -std=legacy is not supported""
This reverts commit aa1e969. We are now using the standard method to do this, which should not change how any other tests behave. I mistakenly believed that this feature was broken when the change from macro to function was made.
1 parent b1854df commit 9fb1916

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Fortran/UnitTests/fcvs21_f95/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@
3333
# clean-up fort.* files otherwise one of the tests will fail
3434
llvm_test_prepare(rm -f %S/fort.*)
3535

36-
# Test 509 requires this flag in more recent versions of GCC
36+
file(GLOB Source CONFIGURE_DEPENDS *.f)
37+
38+
# Test 509 requires this flag in more recent versions of GCC.
39+
# If this flag is not supported, the test should be excluded.
3740
check_fortran_compiler_flag("-std=legacy" SUPPORTS_LEGACY)
3841
if (SUPPORTS_LEGACY)
3942
add_compile_options(-std=legacy)
40-
endif ()
43+
else()
44+
# Regex because the GLOB returns the full path to each file
45+
list(FILTER Source EXCLUDE REGEX "FM509\.f$")
46+
endif()
4147

4248
set(FP_TOLERANCE 1.0e-11) # set by the most sensitive numerical test
4349
llvm_singlesource()

cmake/modules/SingleMultiSource.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#
1515
# llvm_singlesource([PREFIX p])
1616
#
17-
# Invokes llvm_test_executable() for each c/c++ source file. If
18-
# 'sources is emptyno sources are specified, creates test executables
19-
# for all C/C++ files in current directory.
17+
# Invokes llvm_test_executable() for each C/C++/Fortran source file. If
18+
# 'sources is empty no sources are specified, creates test executables
19+
# for all source files in the current directory.
2020
# Passes optional PREFIX parameter to llvm_test_executable().
2121
#
2222
# llvm_multisource(target)
@@ -27,7 +27,7 @@
2727
include(TestSuite)
2828

2929
# Configure the current directory as a SingleSource subdirectory - i.e. every
30-
# file in *.{c,cpp,cc} is treated as its own test.
30+
# C/C++/Fortran file is treated as its own test.
3131
function(llvm_singlesource)
3232
cmake_parse_arguments(_LSARG "" "PREFIX" "" ${ARGN})
3333
if(DEFINED Source)

0 commit comments

Comments
 (0)