summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
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 /Tests/CompileFeatures
parent5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5 (diff)
downloadCMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.zip
CMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.tar.gz
CMake-c299fd8266cdbf0762bfe5c8cd994c603d8e23da.tar.bz2
Tests/CompileFeatures: Cover hip_std_## meta-features
Diffstat (limited to 'Tests/CompileFeatures')
-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
8 files changed, 31 insertions, 1 deletions
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