summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CudaOnly/CUBIN/CMakeLists.txt10
-rw-r--r--Tests/CudaOnly/CUBIN/main.cu2
-rw-r--r--Tests/CudaOnly/CUBIN/main_no_native_archs.cu4
-rw-r--r--Tests/CudaOnly/Fatbin/main.cu2
-rw-r--r--Tests/FindPython/Python3SABIModule/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake3
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake3
-rw-r--r--Tests/RunCMake/showIncludes.c14
10 files changed, 45 insertions, 3 deletions
diff --git a/Tests/CudaOnly/CUBIN/CMakeLists.txt b/Tests/CudaOnly/CUBIN/CMakeLists.txt
index 464714b..81787e4 100644
--- a/Tests/CudaOnly/CUBIN/CMakeLists.txt
+++ b/Tests/CudaOnly/CUBIN/CMakeLists.txt
@@ -1,9 +1,17 @@
cmake_minimum_required(VERSION 3.18)
+unset(ENV{CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP}) # CUBIN needs true native arch
project(CudaCUBIN LANGUAGES CUDA)
-
set(CMAKE_CUDA_ARCHITECTURES all-major)
+# CUBIN needs the true native arch to be supported by the CUDA toolkit.
+set(unavailable_native_archs "${CMAKE_CUDA_ARCHITECTURES_NATIVE}")
+list(REMOVE_ITEM unavailable_native_archs ${CMAKE_CUDA_ARCHITECTURES_ALL})
+if(unavailable_native_archs)
+ add_executable(CudaOnlyCUBIN main_no_native_archs.cu)
+ return()
+endif()
+
add_library(CudaCUBIN OBJECT kernelA.cu kernelB.cu kernelC.cu)
set_property(TARGET CudaCUBIN PROPERTY CUDA_CUBIN_COMPILATION ON)
set_property(TARGET CudaCUBIN PROPERTY CUDA_ARCHITECTURES native)
diff --git a/Tests/CudaOnly/CUBIN/main.cu b/Tests/CudaOnly/CUBIN/main.cu
index da5249c..581970a 100644
--- a/Tests/CudaOnly/CUBIN/main.cu
+++ b/Tests/CudaOnly/CUBIN/main.cu
@@ -53,4 +53,6 @@ int main()
return 1;
}
}
+
+ return 0;
}
diff --git a/Tests/CudaOnly/CUBIN/main_no_native_archs.cu b/Tests/CudaOnly/CUBIN/main_no_native_archs.cu
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/CudaOnly/CUBIN/main_no_native_archs.cu
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/Fatbin/main.cu b/Tests/CudaOnly/Fatbin/main.cu
index 903feee..89af0e3 100644
--- a/Tests/CudaOnly/Fatbin/main.cu
+++ b/Tests/CudaOnly/Fatbin/main.cu
@@ -53,4 +53,6 @@ int main()
return 1;
}
}
+
+ return 0;
}
diff --git a/Tests/FindPython/Python3SABIModule/CMakeLists.txt b/Tests/FindPython/Python3SABIModule/CMakeLists.txt
index 1a909ec..e045b69 100644
--- a/Tests/FindPython/Python3SABIModule/CMakeLists.txt
+++ b/Tests/FindPython/Python3SABIModule/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.7)
project(TestPython3SABIModule LANGUAGES C)
@@ -35,12 +35,16 @@ if(NOT TARGET Python3::SABIModule)
message(SEND_ERROR "Python3::SABIModule not found")
endif()
+if (Python3_VERSION VERSION_GREATER_EQUAL "3.2" AND NOT Python3_SOSABI)
+ message(FATAL_ERROR "Python3_SOSABI unexpectedly not defined")
+endif()
+
Python3_add_library (spam3 MODULE USE_SABI 3 WITH_SOABI ../spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
if (Python3_SOSABI)
get_property (suffix TARGET spam3 PROPERTY SUFFIX)
- if (NOT suffix MATCHES "^.${Python3_SOSABI}")
+ if (NOT suffix MATCHES "^\\.${Python3_SOSABI}")
message(FATAL_ERROR "Module suffix do not include Python3_SOSABI")
endif()
endif()
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 91c48c6..619e94a 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -46,6 +46,7 @@ if(WIN32)
if(RunCMake_MAKE_PROGRAM)
set(maybe_MAKE_PROGRAM "-DRunCMake_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}")
endif()
+ run_cmake_script(ShowIncludes-437-ClangCl -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
run_cmake_script(ShowIncludes-437-English -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
run_cmake_script(ShowIncludes-437-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
run_cmake_script(ShowIncludes-437-German -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake
new file mode 100644
index 0000000..6136463
--- /dev/null
+++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake
@@ -0,0 +1,3 @@
+# 'clang-cl /showIncludes' prefix.
+set(expect "Note: including file: ")
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake)
diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt
new file mode 100644
index 0000000..bda7eab
--- /dev/null
+++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt
@@ -0,0 +1 @@
+-- showIncludes='Note: including file: '
diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake
new file mode 100644
index 0000000..7eca3d3
--- /dev/null
+++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake
@@ -0,0 +1,3 @@
+set(CODEPAGE 437)
+set(VSLANG "clang-cl") # Special case for test, not a real VS value.
+include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)
diff --git a/Tests/RunCMake/showIncludes.c b/Tests/RunCMake/showIncludes.c
index 4ea2bcc..5afe04a 100644
--- a/Tests/RunCMake/showIncludes.c
+++ b/Tests/RunCMake/showIncludes.c
@@ -28,6 +28,15 @@ int main()
printf("OEM code page: %u\n", GetOEMCP());
printf("VSLANG: %s\n", vslang);
+ // clang-cl (special case for test, not a real VS value).
+ if (strcmp(vslang, "clang-cl") == 0) {
+ if (cp == 437 || cp == 65001) {
+ printf("Note: including file: ./foo.h\n");
+ return 0;
+ }
+ }
+
+ // German.
if (strcmp(vslang, "1031") == 0) {
if (cp == 437 || cp == 65001) {
printf("Hinweis: Einlesen der Datei: C:\\foo.h\n");
@@ -35,6 +44,7 @@ int main()
}
}
+ // English.
if (strcmp(vslang, "1033") == 0) {
if (cp == 437 || cp == 65001) {
printf("Note: including file: C:\\foo.h\n");
@@ -42,6 +52,7 @@ int main()
}
}
+ // French.
if (strcmp(vslang, "1036") == 0) {
if (cp == 437 || cp == 863) {
printf("Remarque\xff: inclusion du fichier\xff: C:\\foo.h\n");
@@ -53,6 +64,7 @@ int main()
}
}
+ // Italian.
if (strcmp(vslang, "1040") == 0) {
if (cp == 437 || cp == 65001) {
printf("Nota: file incluso C:\\foo.h\n");
@@ -60,6 +72,7 @@ int main()
}
}
+ // Japanese.
if (strcmp(vslang, "1041") == 0) {
if (cp == 932) {
printf("\x83\x81\x83\x82: "
@@ -75,6 +88,7 @@ int main()
}
}
+ // Chinese.
if (strcmp(vslang, "2052") == 0) {
if (cp == 54936 || cp == 936) {
printf("\xd7\xa2\xd2\xe2: "