From dae998ff9ded76ddf85967bf2e12f1675e1e980a Mon Sep 17 00:00:00 2001 From: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com> Date: Thu, 31 Jul 2025 12:24:30 +0100 Subject: [PATCH] Enable -Wnarrowing in spirv_new test suite (#2468) --- test_conformance/spirv_new/CMakeLists.txt | 4 ---- test_conformance/spirv_new/test_spirv_14.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/test_conformance/spirv_new/CMakeLists.txt b/test_conformance/spirv_new/CMakeLists.txt index 13a258e5..e32d600b 100644 --- a/test_conformance/spirv_new/CMakeLists.txt +++ b/test_conformance/spirv_new/CMakeLists.txt @@ -38,10 +38,6 @@ set(TEST_HARNESS_SOURCES ../../test_conformance/math_brute_force/utility.cpp ) -if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang") - add_cxx_flag_if_supported(-Wno-narrowing) -endif() - set(${MODULE_NAME}_SOURCES ${${MODULE_NAME}_SOURCES} ${TEST_HARNESS_SOURCES}) include(../CMakeCommon.txt) diff --git a/test_conformance/spirv_new/test_spirv_14.cpp b/test_conformance/spirv_new/test_spirv_14.cpp index 6fc5e864..01df8dfd 100644 --- a/test_conformance/spirv_new/test_spirv_14.cpp +++ b/test_conformance/spirv_new/test_spirv_14.cpp @@ -26,10 +26,10 @@ static int test_image_operand_helper(cl_device_id deviceID, cl_context context, { const char* filename = signExtend ? "spv1.4/image_operand_signextend" : "spv1.4/image_operand_zeroextend"; - cl_image_format image_format = { - CL_RGBA, - signExtend ? CL_SIGNED_INT8 : CL_UNSIGNED_INT8, - }; + cl_image_format image_format = {}; + image_format.image_channel_order = CL_RGBA; + image_format.image_channel_data_type = + signExtend ? CL_SIGNED_INT8 : CL_UNSIGNED_INT8; cl_int error = CL_SUCCESS;