summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx53
-rw-r--r--Tests/CMakeLists.txt5
-rw-r--r--Tests/MSVCDebugInformationFormat/override-Fortran.cmake8
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CXXModules/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt2
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx11
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx2
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order-randomized/CMakeLists.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/CMakeLists.txt132
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod1.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod2.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod3.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod4.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod5.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod6.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod7.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl-non-partition.cxx10
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl1.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl2.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl3.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl4.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl5.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl6.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl7.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf1.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf2.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf3.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf4.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf5.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf6.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf7.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/partition_level.cxx15
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target1.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target2.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target3.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target4.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target5.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target6.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target7.cxx7
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input20
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output2
47 files changed, 500 insertions, 12 deletions
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index aab084b..6014889 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -297,7 +297,12 @@ bool testUVProcessChainBuiltin(const char* helperCommand)
.AddCommand({ helperCommand, "capitalize" })
.AddCommand({ helperCommand, "dedup" })
.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
- .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR)
+ .SetBuiltinLoop();
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -400,6 +405,10 @@ bool testUVProcessChainExternal(const char* helperCommand)
.AddCommand({ helperCommand, "dedup" })
.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, outputPipe[1])
.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, errorPipe[1]);
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -668,6 +677,43 @@ bool testUVProcessChainWait0(const char* helperCommand)
return true;
}
+bool testUVProcessChainExternalLoop(const char* helperCommand)
+{
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand({ helperCommand, "echo" })
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetExternalLoop(*loop);
+ if (builder.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ auto chain = builder.Start();
+
+ if (&chain.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ if (!chain.Wait()) {
+ std::cout << "Wait() timed out" << std::endl;
+ return false;
+ }
+
+ cmUVPipeIStream stream(chain.GetLoop(), chain.OutputStream());
+ std::string output = getInput(stream);
+ if (output != "HELLO world!") {
+ std::cout << "Output was \"" << output << "\", expected \"HELLO world!\""
+ << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
int testUVProcessChain(int argc, char** const argv)
{
if (argc < 2) {
@@ -720,5 +766,10 @@ int testUVProcessChain(int argc, char** const argv)
return -1;
}
+ if (!testUVProcessChainExternalLoop(argv[1])) {
+ std::cout << "While executing testUVProcessChainExternalLoop().\n";
+ return -1;
+ }
+
return 0;
}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4c61eab..a1619ec 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2154,10 +2154,7 @@ if(BUILD_TESTING)
endif()
set(MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
- if(CMAKE_Fortran_COMPILER
- # FIXME(LLVMFlang): It does not provide debug information format flags or predefines.
- AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang"
- )
+ if(CMAKE_Fortran_COMPILER)
list(APPEND MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_Fortran=1)
endif()
ADD_TEST_MACRO(MSVCDebugInformationFormat)
diff --git a/Tests/MSVCDebugInformationFormat/override-Fortran.cmake b/Tests/MSVCDebugInformationFormat/override-Fortran.cmake
index 5d2db58..8bc2067 100644
--- a/Tests/MSVCDebugInformationFormat/override-Fortran.cmake
+++ b/Tests/MSVCDebugInformationFormat/override-Fortran.cmake
@@ -2,3 +2,11 @@ set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded")
string(REPLACE "-Z7" "-Z7;-DTEST_Z7" "${var}" "${${var}}")
set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase")
string(REPLACE "-Zi" "-Zi;-DTEST_Zi" "${var}" "${${var}}")
+
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
+ set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded")
+ string(REPLACE "-g" "-g;-DTEST_Z7" "${var}" "${${var}}")
+ # LLVMFlang does not actually support these, but Windows-LLVMFlang-Fortran pretends it does.
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "-DTEST_Zi")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "-DTEST_ZI")
+endif()
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 2a8a152..4cd200a 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -21,14 +21,16 @@ foreach(t MultiThreaded SingleThreaded)
endforeach()
endforeach()
endforeach()
-if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
- # LLVMFlang does not actually define these, so inject them
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
+ # LLVMFlang < 18.0 does not define these, so inject them.
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "-D_MT")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "-D_MT;-D_DLL")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "-D_MT;-D_DEBUG")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "-D_MT;-D_DEBUG;-D_DLL")
endif()
-string(APPEND CMAKE_Fortran_FLAGS " -w")
+if(NOT CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC")
+ string(APPEND CMAKE_Fortran_FLAGS " -w")
+endif()
function(verify_combinations threads lang src)
set(verify_tc_config_ Release)
diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
index 0c0f1b4..fcfa60a 100644
--- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
@@ -174,6 +174,8 @@ if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION)
run_cxx_module_test(object-library)
run_cxx_module_test(generated)
run_cxx_module_test(deep-chain)
+ run_cxx_module_test(non-trivial-collation-order)
+ run_cxx_module_test(non-trivial-collation-order-randomized)
run_cxx_module_test(duplicate)
set(RunCMake_CXXModules_NO_TEST 1)
run_cxx_module_test(circular)
diff --git a/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt b/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt
index ac80356..f6f5e5f 100644
--- a/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt
+++ b/Tests/RunCMake/CXXModules/examples/circular-build-stdout.txt
@@ -1 +1 @@
-((Ninja generators)?(build stopped: dependency cycle:)|(Visual Studio generators)?(error : Cannot build the following source files because there is a cyclic dependency between them))
+((Ninja generators)?(CMake Error: Circular dependency detected in the C\+\+ module import graph. See modules named: "a", "b")|(Visual Studio generators)?(error : Cannot build the following source files because there is a cyclic dependency between them))
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt
index bf99f7c..ecbae34 100644
--- a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt
@@ -19,7 +19,8 @@ target_sources(internal-partitions
"${CMAKE_CURRENT_SOURCE_DIR}"
FILES
importable.cxx
- partition.cxx)
+ partition.cxx
+ internal.cxx)
target_compile_features(internal-partitions PUBLIC cxx_std_20)
add_executable(exe)
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx
index 3b3d313..b180cb0 100644
--- a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx
@@ -3,6 +3,12 @@ import :internal_partition;
#include "internal-partitions_export.h"
+export struct module_struct
+{
+private:
+ partition_struct p;
+};
+
export INTERNAL_PARTITIONS_EXPORT int from_import()
{
return from_partition();
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx
new file mode 100644
index 0000000..9dc1470
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/internal.cxx
@@ -0,0 +1,11 @@
+export module internal;
+
+export struct internal_struct
+{
+ int x;
+};
+
+export int from_internal()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx
index feb38d2..692a470 100644
--- a/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx
@@ -2,5 +2,5 @@ import importable;
int main(int argc, char* argv[])
{
- return from_import();
+ return from_import() * sizeof(module_struct);
}
diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
index c828612..67ab2ff3 100644
--- a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
+++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
@@ -1,6 +1,12 @@
module importable:internal_partition;
+import internal;
+
+struct partition_struct
+{
+ internal_struct i;
+};
int from_partition()
{
- return 0;
+ return from_internal();
}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order-randomized/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order-randomized/CMakeLists.txt
new file mode 100644
index 0000000..4e1e7af
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order-randomized/CMakeLists.txt
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.24...3.28)
+project(cxx_modules_non_trivial_collation_order_randomized CXX)
+
+include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
+
+set(non_trivial_collation_order_randomized TRUE)
+
+add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../non-trivial-collation-order/"
+ "${CMAKE_CURRENT_BINARY_DIR}/non-trivial-collation-order")
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/CMakeLists.txt
new file mode 100644
index 0000000..218b45f
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/CMakeLists.txt
@@ -0,0 +1,132 @@
+cmake_minimum_required(VERSION 3.24...3.28)
+project(cxx_modules_non_trivial_collation_order CXX)
+
+include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ include(CheckCompilerFlag)
+ check_compiler_flag(CXX "-Wread-modules-implicitly" have_implicit_module_warning)
+ if (have_implicit_module_warning)
+ add_compile_options(-Werror=read-modules-implicitly)
+ endif ()
+endif ()
+
+# Returns an random integer from range [0,length)
+function(get_random_index result length)
+ # math(EXPR) parses and evaluates as 64-bit signed integer.
+ string(RANDOM LENGTH 18 ALPHABET "0123456789" value)
+ # Modulo is not uniformly distributed, but we doesn't need that here.
+ math(EXPR ${result} "${value} % ${length}")
+ return(PROPAGATE ${result})
+endfunction()
+
+# Shuffle list_var randomly
+function(shuffle_list list_var)
+ set(result)
+ set(length 0)
+ foreach(item IN LISTS "${list_var}")
+ math(EXPR length "${length} + 1")
+ get_random_index(index ${length})
+ list(INSERT result ${index} "${item}")
+ endforeach()
+ set("${list_var}" "${result}" PARENT_SCOPE)
+endfunction()
+
+# The import chain is:
+# impl-non-partition --(implicitly)--> partition_level(primary interface unit)
+# --> :intf7 --> :intf6 --> :intf5 --> :intf4 --> :intf3 --> :intf2 --> :intf1
+# --> :impl7 --> :impl6 --> :impl5 --> :impl4 --> :impl3 --> :impl2 --> :impl1
+set(partition_level_srcs
+ partition_level/partition_level.cxx
+ partition_level/intf1.cxx
+ partition_level/intf3.cxx
+ partition_level/intf4.cxx
+ partition_level/intf2.cxx # intentional order
+ partition_level/intf5.cxx
+ partition_level/intf6.cxx
+ partition_level/intf7.cxx
+ partition_level/impl1.cxx
+ partition_level/impl3.cxx
+ partition_level/impl4.cxx
+ partition_level/impl2.cxx # intentional order
+ partition_level/impl5.cxx
+ partition_level/impl6.cxx
+ partition_level/impl7.cxx
+)
+
+# The import chain is:
+# mod7 --> mod6 --> mod5 --> mod4 --> mod3 --> mod2 --> mod1 --> partition_level
+set(module_level_srcs
+ ${partition_level_srcs}
+ module_level/mod1.cxx
+ module_level/mod3.cxx
+ module_level/mod4.cxx
+ module_level/mod2.cxx # intentional order
+ module_level/mod5.cxx
+ module_level/mod6.cxx
+ module_level/mod7.cxx
+)
+
+# The import chain is:
+# target7 --> target6 --> target5 --> target4 -->
+# target3 --> target2 --> target1 --> target_module_level
+set(targets
+ target_module_level
+ target1
+ target3
+ target4
+ target2 # intentional order
+ target5
+ target6
+ target7
+)
+
+if(non_trivial_collation_order_randomized)
+ shuffle_list(module_level_srcs)
+ shuffle_list(targets)
+endif()
+
+message(STATUS "module_level_srcs: ${module_level_srcs}")
+message(STATUS "targets: ${targets}")
+
+foreach(tgt IN LISTS targets)
+ if (tgt STREQUAL "target_module_level")
+
+ add_library(target_module_level STATIC)
+ target_sources(target_module_level
+ PUBLIC
+ FILE_SET CXX_MODULES
+ BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
+ FILES ${module_level_srcs}
+ PRIVATE
+ partition_level/impl-non-partition.cxx
+ )
+ target_compile_features(target_module_level PUBLIC cxx_std_20)
+
+ else()
+
+ add_library(${tgt} STATIC)
+ target_sources(${tgt}
+ PUBLIC
+ FILE_SET CXX_MODULES
+ BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
+ FILES target_level/${tgt}.cxx
+ )
+ target_compile_features(${tgt} PUBLIC cxx_std_20)
+ if (tgt MATCHES "^target([2-9])$")
+ math(EXPR dep_number "${CMAKE_MATCH_1} - 1")
+ target_link_libraries(${tgt} PRIVATE "target${dep_number}")
+ else()
+ target_link_libraries(${tgt} PRIVATE target_module_level)
+ endif()
+
+ endif()
+endforeach()
+
+add_executable(exe)
+target_link_libraries(exe PRIVATE target7)
+target_sources(exe
+ PRIVATE
+ main.cxx)
+
+add_test(NAME exe COMMAND exe)
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/main.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/main.cxx
new file mode 100644
index 0000000..6496776
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/main.cxx
@@ -0,0 +1,6 @@
+import target7;
+
+int main()
+{
+ return target7();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod1.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod1.cxx
new file mode 100644
index 0000000..1999688
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod1.cxx
@@ -0,0 +1,7 @@
+export module mod1;
+import partition_level;
+
+export int mod1()
+{
+ return partition_level::get();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod2.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod2.cxx
new file mode 100644
index 0000000..454899f
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod2.cxx
@@ -0,0 +1,7 @@
+export module mod2;
+import mod1;
+
+export int mod2()
+{
+ return mod1();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod3.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod3.cxx
new file mode 100644
index 0000000..85dea1e
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod3.cxx
@@ -0,0 +1,7 @@
+export module mod3;
+import mod2;
+
+export int mod3()
+{
+ return mod2();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod4.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod4.cxx
new file mode 100644
index 0000000..e6143d7
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod4.cxx
@@ -0,0 +1,7 @@
+export module mod4;
+import mod3;
+
+export int mod4()
+{
+ return mod3();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod5.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod5.cxx
new file mode 100644
index 0000000..94355a9
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod5.cxx
@@ -0,0 +1,7 @@
+export module mod5;
+import mod4;
+
+export int mod5()
+{
+ return mod4();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod6.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod6.cxx
new file mode 100644
index 0000000..998ed8b
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod6.cxx
@@ -0,0 +1,7 @@
+export module mod6;
+import mod5;
+
+export int mod6()
+{
+ return mod5();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod7.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod7.cxx
new file mode 100644
index 0000000..15c52b0
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/module_level/mod7.cxx
@@ -0,0 +1,7 @@
+export module mod7;
+import mod6;
+
+export int mod7()
+{
+ return mod6();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl-non-partition.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl-non-partition.cxx
new file mode 100644
index 0000000..0cf184f
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl-non-partition.cxx
@@ -0,0 +1,10 @@
+module partition_level;
+
+namespace partition_level {
+int non_partition()
+{
+ return primary() + intf1() + intf2() + intf3() + intf4() + intf5() +
+ intf6() + intf7() + impl1() + impl2() + impl3() + impl4() + impl5() +
+ impl6() + impl7();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl1.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl1.cxx
new file mode 100644
index 0000000..86c27c6
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl1.cxx
@@ -0,0 +1,7 @@
+module partition_level:impl1;
+namespace partition_level {
+int impl1()
+{
+ return 0;
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl2.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl2.cxx
new file mode 100644
index 0000000..49d10e3
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl2.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl2;
+import :impl1;
+namespace partition_level {
+int impl2()
+{
+ return impl1();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl3.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl3.cxx
new file mode 100644
index 0000000..cbd183b
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl3.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl3;
+import :impl2;
+namespace partition_level {
+int impl3()
+{
+ return impl2();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl4.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl4.cxx
new file mode 100644
index 0000000..7ce9390
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl4.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl4;
+import :impl3;
+namespace partition_level {
+int impl4()
+{
+ return impl3();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl5.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl5.cxx
new file mode 100644
index 0000000..901eda9
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl5.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl5;
+import :impl4;
+namespace partition_level {
+int impl5()
+{
+ return impl4();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl6.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl6.cxx
new file mode 100644
index 0000000..38130c7
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl6.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl6;
+import :impl5;
+namespace partition_level {
+int impl6()
+{
+ return impl5();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl7.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl7.cxx
new file mode 100644
index 0000000..c3b1322
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/impl7.cxx
@@ -0,0 +1,8 @@
+module partition_level:impl7;
+import :impl6;
+namespace partition_level {
+int impl7()
+{
+ return impl6();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf1.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf1.cxx
new file mode 100644
index 0000000..5d8500d
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf1.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf1;
+import :impl7;
+namespace partition_level {
+int intf1()
+{
+ return impl7();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf2.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf2.cxx
new file mode 100644
index 0000000..76c6eed
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf2.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf2;
+export import :intf1;
+namespace partition_level {
+int intf2()
+{
+ return intf1();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf3.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf3.cxx
new file mode 100644
index 0000000..3b16053
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf3.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf3;
+export import :intf2;
+namespace partition_level {
+int intf3()
+{
+ return intf2();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf4.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf4.cxx
new file mode 100644
index 0000000..2826717
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf4.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf4;
+export import :intf3;
+namespace partition_level {
+int intf4()
+{
+ return intf3();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf5.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf5.cxx
new file mode 100644
index 0000000..ede117e
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf5.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf5;
+export import :intf4;
+namespace partition_level {
+int intf5()
+{
+ return intf4();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf6.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf6.cxx
new file mode 100644
index 0000000..c89a554
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf6.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf6;
+export import :intf5;
+namespace partition_level {
+int intf6()
+{
+ return intf5();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf7.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf7.cxx
new file mode 100644
index 0000000..ee0b250
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/intf7.cxx
@@ -0,0 +1,8 @@
+export module partition_level:intf7;
+export import :intf6;
+namespace partition_level {
+int intf7()
+{
+ return intf6();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/partition_level.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/partition_level.cxx
new file mode 100644
index 0000000..7f3ddb2
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/partition_level/partition_level.cxx
@@ -0,0 +1,15 @@
+export module partition_level;
+export import :intf7;
+namespace partition_level {
+int primary()
+{
+ return intf7();
+}
+
+int non_partition();
+
+export int get()
+{
+ return non_partition();
+}
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target1.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target1.cxx
new file mode 100644
index 0000000..5487e21
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target1.cxx
@@ -0,0 +1,7 @@
+export module target1;
+import mod7;
+
+export int target1()
+{
+ return mod7();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target2.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target2.cxx
new file mode 100644
index 0000000..52c87dc
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target2.cxx
@@ -0,0 +1,7 @@
+export module target2;
+import target1;
+
+export int target2()
+{
+ return target1();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target3.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target3.cxx
new file mode 100644
index 0000000..4a1a3c0
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target3.cxx
@@ -0,0 +1,7 @@
+export module target3;
+import target2;
+
+export int target3()
+{
+ return target2();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target4.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target4.cxx
new file mode 100644
index 0000000..da1bf9d
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target4.cxx
@@ -0,0 +1,7 @@
+export module target4;
+import target3;
+
+export int target4()
+{
+ return target3();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target5.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target5.cxx
new file mode 100644
index 0000000..f18df7a
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target5.cxx
@@ -0,0 +1,7 @@
+export module target5;
+import target4;
+
+export int target5()
+{
+ return target4();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target6.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target6.cxx
new file mode 100644
index 0000000..a598df8
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target6.cxx
@@ -0,0 +1,7 @@
+export module target6;
+import target5;
+
+export int target6()
+{
+ return target5();
+}
diff --git a/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target7.cxx b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target7.cxx
new file mode 100644
index 0000000..641cfbc
--- /dev/null
+++ b/Tests/RunCMake/CXXModules/examples/non-trivial-collation-order/target_level/target7.cxx
@@ -0,0 +1,7 @@
+export module target7;
+import target6;
+
+export int target7()
+{
+ return target6();
+}
diff --git a/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input b/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input
new file mode 100644
index 0000000..c567f06
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input
@@ -0,0 +1,20 @@
+CMAKE_LANG=Fortran
+CMAKE_LINKER=
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=x64
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=LLVMFlang
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+CMAKE_Fortran_SIMULATE_ID=MSVC
+flang-new version 18.0.0
+Target: x86_64-pc-windows-msvc
+Thread model: posix
+InstalledDir: C:\DoesNotExist\LLVM\bin
+ "C:\\DoesNotExist\\LLVM\\bin\\flang-new" -fc1 -triple x86_64-pc-windows-msvc19.36.32543 -emit-obj -mrelocation-model pic -pic-level 2 -target-cpu x86-64 --dependent-lib=clang_rt.builtins-x86_64.lib -D_MT --dependent-lib=libcmt --dependent-lib=Fortran_main.static.lib --dependent-lib=FortranRuntime.static.lib --dependent-lib=FortranDecimal.static.lib -D_MSC_VER=1936 -D_MSC_FULL_VER=193632543 -D_WIN32 -D_M_X64=100 -mframe-pointer=none -o "C:\\DoesNotExist\\Temp\\CMakeFortranCompilerABI-e91f95.o" -x f95-cpp-input CMakeFortranCompilerABI.F
+ "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x64\\link.exe" -out:a.exe "-libpath:C:\\DoesNotExist\\LLVM\\lib" /WHOLEARCHIVE:Fortran_main.static.lib /subsystem:console "-libpath:C:\\DoesNotExist\\LLVM\\lib\\clang\\18\\lib\\windows" -nologo "C:\\DoesNotExist\\Temp\\CMakeFortranCompilerABI-e91f95.o"
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index 04998a2..0ede9ee 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -43,6 +43,7 @@ set(targets
openbsd-C-Clang-5.0.1 openbsd-CXX-Clang-5.0.1
sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0 sunos-Fortran-SunPro-8.8.0
windows_x86_64-C-Clang-17.0.1-MSVC windows_x86_64-CXX-Clang-17.0.1-MSVC windows_x86_64-Fortran-LLVMFlang-17.0.1-MSVC
+ windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC
windows_arm64-C-Clang-17.0.1-MSVC windows_arm64-CXX-Clang-17.0.1-MSVC windows_arm64-Fortran-LLVMFlang-17.0.1-MSVC
)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output
new file mode 100644
index 0000000..c8266a5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output
@@ -0,0 +1,2 @@
+libs=
+dirs=C:/DoesNotExist/LLVM/lib;C:/DoesNotExist/LLVM/lib/clang/18/lib/windows