https://github.com/wenju-he created 
https://github.com/llvm/llvm-project/pull/176683

Verify all variants of get_image_height builtins are declared in opencl-c.h.

>From f053d21be6f8073b10d7f1c68a04e81878519c6c Mon Sep 17 00:00:00 2001
From: Wenju He <[email protected]>
Date: Mon, 19 Jan 2026 02:57:17 +0100
Subject: [PATCH] [OpenCL][NFC] test get_image_height with
 -finclude-default-header

Verify all variants of get_image_height builtins are declared in opencl-c.h.
---
 clang/test/SemaOpenCL/get_image_height.cl | 118 ++++++++++++++++++++++
 1 file changed, 118 insertions(+)
 create mode 100644 clang/test/SemaOpenCL/get_image_height.cl

diff --git a/clang/test/SemaOpenCL/get_image_height.cl 
b/clang/test/SemaOpenCL/get_image_height.cl
new file mode 100644
index 0000000000000..574de1f1c1ddd
--- /dev/null
+++ b/clang/test/SemaOpenCL/get_image_height.cl
@@ -0,0 +1,118 @@
+// RUN: %clang_cc1 %s -triple spir64 -cl-std=CL2.0 -finclude-default-header 
-verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 %s -triple amdgcn-unknown-unknown -cl-std=CL2.0 
-finclude-default-header -verify -pedantic -fsyntax-only
+
+// expected-no-diagnostics
+
+int test_read_1(read_only image2d_t im2d) {
+  return get_image_height(im2d);
+}
+
+int test_read_2(read_only image3d_t im3d) {
+  return get_image_height(im3d);
+}
+
+int test_read_3(read_only image2d_array_t im2d_arr) {
+  return get_image_height(im2d_arr);
+}
+
+int test_read_4(read_only image2d_depth_t im2d_depth) {
+  return get_image_height(im2d_depth);
+}
+
+int test_read_5(read_only image2d_array_depth_t im2d_arr_depth) {
+  return get_image_height(im2d_arr_depth);
+}
+
+#ifdef cl_khr_gl_msaa_sharing
+int test_read_6(read_only image2d_msaa_t im2d_msaa) {
+  return get_image_height(im2d_msaa);
+}
+
+int test_read_7(read_only image2d_msaa_depth_t im2d_msaa_depth) {
+  return get_image_height(im2d_msaa_depth);
+}
+
+int test_read_8(read_only image2d_array_msaa_t im2d_arr_msaa) {
+  return get_image_height(im2d_arr_msaa);
+}
+
+int test_read_9(read_only image2d_array_msaa_depth_t im2d_arr_msaa_depth) {
+  return get_image_height(im2d_arr_msaa_depth);
+}
+#endif // cl_khr_gl_msaa_sharing
+
+int test_write_1(write_only image2d_t im2d) {
+  return get_image_height(im2d);
+}
+
+int test_write_2(write_only image3d_t im3d) {
+  return get_image_height(im3d);
+}
+
+int test_write_3(write_only image2d_array_t im2d_arr) {
+  return get_image_height(im2d_arr);
+}
+
+int test_write_4(write_only image2d_depth_t im2d_depth) {
+  return get_image_height(im2d_depth);
+}
+
+int test_write_5(write_only image2d_array_depth_t im2d_arr_depth) {
+  return get_image_height(im2d_arr_depth);
+}
+
+#ifdef cl_khr_gl_msaa_sharing
+int test_write_6(write_only image2d_msaa_t im2d_msaa) {
+  return get_image_height(im2d_msaa);
+}
+
+int test_write_7(write_only image2d_msaa_depth_t im2d_msaa_depth) {
+  return get_image_height(im2d_msaa_depth);
+}
+
+int test_write_8(write_only image2d_array_msaa_t im2d_arr_msaa) {
+  return get_image_height(im2d_arr_msaa);
+}
+
+int test_write_9(write_only image2d_array_msaa_depth_t im2d_arr_msaa_depth) {
+  return get_image_height(im2d_arr_msaa_depth);
+}
+#endif // cl_khr_gl_msaa_sharing
+
+int test_read_write_1(read_write image2d_t im2d) {
+  return get_image_height(im2d);
+}
+
+int test_read_write_2(read_write image3d_t im3d) {
+  return get_image_height(im3d);
+}
+
+int test_read_write_3(read_write image2d_array_t im2d_arr) {
+  return get_image_height(im2d_arr);
+}
+
+int test_read_write_4(read_write image2d_depth_t im2d_depth) {
+  return get_image_height(im2d_depth);
+}
+
+int test_read_write_5(read_write image2d_array_depth_t im2d_arr_depth) {
+  return get_image_height(im2d_arr_depth);
+}
+
+#ifdef cl_khr_gl_msaa_sharing
+int test_read_write_6(read_write image2d_msaa_t im2d_msaa) {
+  return get_image_height(im2d_msaa);
+}
+
+int test_read_write_7(read_write image2d_msaa_depth_t im2d_msaa_depth) {
+  return get_image_height(im2d_msaa_depth);
+}
+
+int test_read_write_8(read_write image2d_array_msaa_t im2d_arr_msaa) {
+  return get_image_height(im2d_arr_msaa);
+}
+
+int test_read_write_9(read_write image2d_array_msaa_depth_t 
im2d_arr_msaa_depth) {
+  return get_image_height(im2d_arr_msaa_depth);
+}
+#endif // cl_khr_gl_msaa_sharing

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to