summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-28 17:12:36 (GMT)
committerBrad King <brad.king@kitware.com>2024-05-28 18:36:50 (GMT)
commitc299fd8266cdbf0762bfe5c8cd994c603d8e23da (patch)
treec09aac23fa176d6359bdd2b2474870e42c65df08
parent5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5 (diff)
downloadCMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.zip
CMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.tar.gz
CMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.tar.bz2
Tests/CompileFeatures: Cover hip_std_## meta-features
-rw-r--r--.gitlab/ci/configure_debian12_hip_radeon.cmake1
-rw-r--r--.gitlab/ci/configure_fedora39_hip_radeon.cmake1
-rw-r--r--.gitlab/ci/configure_hip5.5_nvidia.cmake1
-rw-r--r--.gitlab/ci/configure_hip5.5_radeon.cmake1
-rw-r--r--Tests/CMakeLists.txt5
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt8
-rw-r--r--Tests/CompileFeatures/hip_std_11.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_14.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_17.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_20.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_23.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_26.hip4
-rw-r--r--Tests/CompileFeatures/hip_std_98.hip0
13 files changed, 39 insertions, 2 deletions
diff --git a/.gitlab/ci/configure_debian12_hip_radeon.cmake b/.gitlab/ci/configure_debian12_hip_radeon.cmake
index c7d7004..d12922a 100644
--- a/.gitlab/ci/configure_debian12_hip_radeon.cmake
+++ b/.gitlab/ci/configure_debian12_hip_radeon.cmake
@@ -1,3 +1,4 @@
set(CMake_TEST_HIP "amd" CACHE BOOL "")
+set(CMake_TEST_HIP_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora39_hip_radeon.cmake b/.gitlab/ci/configure_fedora39_hip_radeon.cmake
index c7d7004..8271af3 100644
--- a/.gitlab/ci/configure_fedora39_hip_radeon.cmake
+++ b/.gitlab/ci/configure_fedora39_hip_radeon.cmake
@@ -1,3 +1,4 @@
set(CMake_TEST_HIP "amd" CACHE BOOL "")
+set(CMake_TEST_HIP_STANDARDS "98;11;14;17;20;23;26" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_hip5.5_nvidia.cmake b/.gitlab/ci/configure_hip5.5_nvidia.cmake
index 4b3511a..036a227 100644
--- a/.gitlab/ci/configure_hip5.5_nvidia.cmake
+++ b/.gitlab/ci/configure_hip5.5_nvidia.cmake
@@ -1,3 +1,4 @@
set(CMake_TEST_HIP "nvidia" CACHE BOOL "")
+set(CMake_TEST_HIP_STANDARDS "98;11;14;17" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_hip5.5_radeon.cmake b/.gitlab/ci/configure_hip5.5_radeon.cmake
index c7d7004..06e47c9 100644
--- a/.gitlab/ci/configure_hip5.5_radeon.cmake
+++ b/.gitlab/ci/configure_hip5.5_radeon.cmake
@@ -1,3 +1,4 @@
set(CMake_TEST_HIP "amd" CACHE BOOL "")
+set(CMake_TEST_CUDA_STANDARDS "98;11;14;17;20;23;26" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index eefe288..51e60fe 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -391,14 +391,17 @@ if(BUILD_TESTING)
string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_C "${CMake_TEST_C_STANDARDS}")
string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_CXX "${CMake_TEST_CXX_STANDARDS}")
string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_CUDA "${CMake_TEST_CUDA_STANDARDS}")
+ string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_HIP "${CMake_TEST_HIP_STANDARDS}")
set(CompileFeatures_BUILD_OPTIONS
-DCMake_TEST_C_STANDARDS=${TEST_STDS_C}
-DCMake_TEST_CXX_STANDARDS=${TEST_STDS_CXX}
-DCMake_TEST_CUDA=${CMake_TEST_CUDA}
-DCMake_TEST_CUDA_STANDARDS=${TEST_STDS_CUDA}
+ -DCMake_TEST_HIP=${CMake_TEST_HIP}
+ -DCMake_TEST_HIP_STANDARDS=${TEST_STDS_HIP}
)
ADD_TEST_MACRO(CompileFeatures CompileFeatures)
- set_property(TEST CompileFeatures APPEND PROPERTY LABELS "CUDA")
+ set_property(TEST CompileFeatures APPEND PROPERTY LABELS "CUDA" "HIP")
ADD_TEST_MACRO(CMakeCommands.target_compile_features)
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 469a085..614b721 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -15,7 +15,13 @@ if(CMake_TEST_CUDA)
set(std_CUDA 03 11 14 17 20 23 26)
endif()
-foreach(lang C CXX CUDA)
+if(CMake_TEST_HIP)
+ enable_language(HIP)
+ set(ext_HIP hip)
+ set(std_HIP 98 11 14 17 20 23 26)
+endif()
+
+foreach(lang C CXX CUDA HIP)
foreach(std IN LISTS std_${lang})
string(TOLOWER "${lang}_std_${std}" feature)
if("${std}" IN_LIST CMake_TEST_${lang}_STANDARDS
diff --git a/Tests/CompileFeatures/hip_std_11.hip b/Tests/CompileFeatures/hip_std_11.hip
new file mode 100644
index 0000000..835aebd
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_11.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD < CXX_STD_11
+# error "hip_std_11 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_14.hip b/Tests/CompileFeatures/hip_std_14.hip
new file mode 100644
index 0000000..9a605d1
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_14.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_11
+# error "hip_std_14 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_17.hip b/Tests/CompileFeatures/hip_std_17.hip
new file mode 100644
index 0000000..b7f3c84
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_17.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_14
+# error "hip_std_17 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_20.hip b/Tests/CompileFeatures/hip_std_20.hip
new file mode 100644
index 0000000..7dfbe75
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_20.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_17
+# error "hip_std_20 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_23.hip b/Tests/CompileFeatures/hip_std_23.hip
new file mode 100644
index 0000000..aa1af72
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_23.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_20
+# error "hip_std_23 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_26.hip b/Tests/CompileFeatures/hip_std_26.hip
new file mode 100644
index 0000000..3c7a2f5
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_26.hip
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_23
+# error "hip_std_26 not honored"
+#endif
diff --git a/Tests/CompileFeatures/hip_std_98.hip b/Tests/CompileFeatures/hip_std_98.hip
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CompileFeatures/hip_std_98.hip