summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-07 14:16:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-12-07 14:16:11 (GMT)
commitb2b0d839c1db57e9b8078882e3d366fff6f1fb4a (patch)
treec042cf5565099bd357626db4bb36b518bfc94ce4 /Tests
parent944a9c35cc002f19b3cad3868da08b4f21c0e556 (diff)
parentcd28915260432cdbcdfb1f715477c262d41867d1 (diff)
downloadCMake-b2b0d839c1db57e9b8078882e3d366fff6f1fb4a.zip
CMake-b2b0d839c1db57e9b8078882e3d366fff6f1fb4a.tar.gz
CMake-b2b0d839c1db57e9b8078882e3d366fff6f1fb4a.tar.bz2
Merge topic 'LLVMFlang-MSVC'
cd28915260 LLVMFlang: Update MSVC ABI and architecture detection for LLVMFlang 18.0 48302b469e LLVMFlang: Update MSVC runtime library selection for LLVMFlang 18.0 1c07758ca2 CMakeParseImplicitLinkInfo: Exclude LLVMFlang program entry point for MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9036
Diffstat (limited to 'Tests')
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt8
-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
4 files changed, 28 insertions, 3 deletions
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/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