From 768d7639c502b6a9a340de65a21b818ece70f693 Mon Sep 17 00:00:00 2001 From: Gergely Meszaros Date: Mon, 16 Jun 2025 07:42:20 -0700 Subject: [PATCH 1/4] [SYCL][E2E] Fix -Werror failures in implicitly SPIR only DeviceLib tests The `-fsycl-device-lib-jit-link` only has an effect in SPIR compilation so these tests would fail with `-Werror` for non SPIR targets. This basically the same as #18985, but also apply it to tests that have `UNSUPPORTED: target-amd || target-nvidia`. These tests could be enabled for future non-SPIR targets we should not be assuming that `!target-amd && !target-nvidia` implies SPIR. --- sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_double2half.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp32_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp index 567b6077bad1a..f0cfa990c8679 100644 --- a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp +++ b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp index 8ea338442e08f..35f0232b64805 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp @@ -3,7 +3,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t1.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t1.out // RUN: %{run} %t1.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_double2half.cpp b/sycl/test-e2e/DeviceLib/imf_double2half.cpp index cdb751b82254f..32c6aeeb7f108 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2half.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2half.cpp @@ -4,7 +4,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // UNSUPPORTED: target-nvidia, target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp index d8c1a3d7d4d69..01be4dd51f1e1 100644 --- a/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp index 12ba40ced5d53..83ee96bd49af9 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp index 755111d9c0c40..813d90b684772 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp index da93d94229fa8..874cdebe3de58 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp index 0a9725c912947..238de0d21f98d 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp index 8ebd3b5f0bcd9..0506105311ab5 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp index 881577618cd93..68fb8d62b36a6 100644 --- a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp +++ b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp @@ -4,7 +4,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // UNSUPPORTED: target-nvidia, target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp b/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp index 0f51c69006b5a..f5b9644da6275 100644 --- a/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd From 60ec587778e573f709a9178f5ba7c6fdfd3f58a8 Mon Sep 17 00:00:00 2001 From: Gergely Meszaros Date: Tue, 17 Jun 2025 04:40:56 -0700 Subject: [PATCH 2/4] [SYCL][E2E] Use `%if target-spir` wherever `-fsycl-device-lib-jit-link` appears Use `%if target-spir` to either conditionally enable the entire run-line (when the run-line only only differs by adding `-fsycl-device-lib-jit-link`), or to conditionally enable the `-fsycl-device-lib-jit-link` flag itself (when there are other differences). --- .../NewOffloadDriver/math_device_lib.cpp | 2 +- sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp | 2 +- sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp | 4 ++-- sycl/test-e2e/DeviceLib/cmath_test.cpp | 4 ++-- .../DeviceLib/imf_bfloat16_integeral_convesions.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_double2half.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp32_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_test.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp | 2 +- sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp | 2 +- sycl/test-e2e/DeviceLib/math_fp64_test.cpp | 4 ++-- sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp | 8 ++++---- sycl/test-e2e/DeviceLib/math_test.cpp | 4 ++-- sycl/test-e2e/DeviceLib/math_windows_test.cpp | 8 ++++---- sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp | 4 ++-- sycl/test-e2e/DeviceLib/std_complex_math_test.cpp | 4 ++-- sycl/test-e2e/DeviceLib/string_test.cpp | 4 ++-- 22 files changed, 35 insertions(+), 35 deletions(-) diff --git a/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp b/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp index 54362f22e86f0..194cf2d6a804f 100644 --- a/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp +++ b/sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp @@ -4,7 +4,7 @@ // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} -// RUN: %{build} --offload-new-driver -fsycl-allow-device-image-dependencies -fsycl-device-lib-jit-link %{mathflags} -o %t.out +// RUN: %{build} --offload-new-driver -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link %} %{mathflags} -o %t.out // RUN: %{run} %t.out #include diff --git a/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp b/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp index a8d32703bd16a..2357d8f6862ae 100644 --- a/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp +++ b/sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp @@ -3,7 +3,7 @@ // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} -// RUN: %{build} -fsycl-allow-device-image-dependencies -fsycl-device-lib-jit-link %{mathflags} -o %t.out +// RUN: %{build} -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link %} %{mathflags} -o %t.out // RUN: %{run} %t.out #include diff --git a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp index 7469395081c38..6cf273a9edab0 100644 --- a/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp @@ -7,8 +7,8 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fsycl-device-lib-jit-link %{mathflags} -o %t2.out -// RUN: %{run} %t2.out +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} +// RUN: %if target-spir %{ %{run} %t2.out %} #include "math_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/cmath_test.cpp b/sycl/test-e2e/DeviceLib/cmath_test.cpp index f5e3220ae0be3..df6b957e81584 100644 --- a/sycl/test-e2e/DeviceLib/cmath_test.cpp +++ b/sycl/test-e2e/DeviceLib/cmath_test.cpp @@ -5,8 +5,8 @@ // RUN: %{build} -fno-builtin %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link %{mathflags} -o %t2.out -// RUN: %if !gpu %{ %{run} %t2.out %} +// RUN: %if target-spir %{ %{build} -fno-builtin -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} // // // Check that --fast-math works with cmath funcs for CUDA // RUN: %if target-nvidia %{ %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s -Wno-nan-infinity-disabled -fno-builtin %{mathflags} -o %t3.out -ffast-math -DSYCL_E2E_FASTMATH %} diff --git a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp index f0cfa990c8679..0349efaa75c26 100644 --- a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp +++ b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out %} // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp index 35f0232b64805..e089f17b739aa 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp @@ -3,7 +3,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t1.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t1.out // RUN: %{run} %t1.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_double2half.cpp b/sycl/test-e2e/DeviceLib/imf_double2half.cpp index 32c6aeeb7f108..0f9eafd5dd569 100644 --- a/sycl/test-e2e/DeviceLib/imf_double2half.cpp +++ b/sycl/test-e2e/DeviceLib/imf_double2half.cpp @@ -4,7 +4,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // UNSUPPORTED: target-nvidia, target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp b/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp index 01be4dd51f1e1..0467ad9061ab8 100644 --- a/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp +++ b/sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp index 83ee96bd49af9..63ba488602e6e 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp index 813d90b684772..a39d735605875 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp32_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp index 874cdebe3de58..982ad54d4ed2c 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_rounding_test.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp index 238de0d21f98d..9876e65b6b4e6 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_test.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp b/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp index 0506105311ab5..e3f192d39b6c5 100644 --- a/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp +++ b/sycl/test-e2e/DeviceLib/imf_fp64_test2.cpp @@ -2,7 +2,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp index 68fb8d62b36a6..437be8257190d 100644 --- a/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp +++ b/sycl/test-e2e/DeviceLib/imf_half_type_cast.cpp @@ -4,7 +4,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // UNSUPPORTED: target-nvidia, target-amd diff --git a/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp b/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp index f5b9644da6275..203c8d96966b1 100644 --- a/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp +++ b/sycl/test-e2e/DeviceLib/imf_simd_emulate_test.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd diff --git a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp index 1a52b322775ad..9810e17b7afe1 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp @@ -7,8 +7,8 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out -// RUN: %if !gpu %{ %{run} %t2.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp index 71e8a43387093..4dca67bd959d9 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp @@ -2,11 +2,11 @@ // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} -// RUN: %{build} %{mathflags} -o %t.out -// RUN: %{run} %t.out +// RUN: %{build} %{mathflags} -o %t1.out +// RUN: %{run} %t1.out -// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %{mathflags} %s -o %t.out -// RUN: %if !gpu %{ %{run} %t.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/math_test.cpp b/sycl/test-e2e/DeviceLib/math_test.cpp index 3ddcee36a9b5e..5bd459cf1f381 100644 --- a/sycl/test-e2e/DeviceLib/math_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_test.cpp @@ -5,8 +5,8 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fsycl-device-lib-jit-link %{mathflags} -o %t2.out -// RUN: %if !gpu %{ %{run} %t2.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/math_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_windows_test.cpp index ab18cf1abe254..bf358f04e1e68 100644 --- a/sycl/test-e2e/DeviceLib/math_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_windows_test.cpp @@ -4,11 +4,11 @@ // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} -// RUN: %{build} %{mathflags} -o %t.out -// RUN: %{run} %t.out +// RUN: %{build} %{mathflags} -o %t1.out +// RUN: %{run} %t1.out -// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %{mathflags} %s -o %t.out -// RUN: %if !gpu %{ %{run} %t.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" #include diff --git a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp index b9c4e424d8357..f89bccfe18da6 100644 --- a/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp @@ -4,8 +4,8 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fsycl-device-lib-jit-link -o %t2.out -// RUN: %{run} %t2.out +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link -o %t2.out %} +// RUN: %if target-spir %{ %{run} %t2.out %} #include #include diff --git a/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp b/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp index 906b8013cabb7..b650a3b53f43d 100644 --- a/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp +++ b/sycl/test-e2e/DeviceLib/std_complex_math_test.cpp @@ -2,8 +2,8 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -Wno-error=unused-command-line-argument -fsycl-device-lib-jit-link %{mathflags} -o %t2.out -// RUN: %{run} %t2.out +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} +// RUN: %if target-spir %{ %{run} %t2.out %} #include #include diff --git a/sycl/test-e2e/DeviceLib/string_test.cpp b/sycl/test-e2e/DeviceLib/string_test.cpp index 2b7f2e904c470..96e4439e15f98 100644 --- a/sycl/test-e2e/DeviceLib/string_test.cpp +++ b/sycl/test-e2e/DeviceLib/string_test.cpp @@ -1,8 +1,8 @@ // RUN: %{build} -Wno-error=deprecated-declarations -Wno-error=pointer-to-int-cast -fno-builtin -o %t1.out // RUN: %{run} %t1.out // -// RUN: %{build} -Wno-error=unused-command-line-argument -Wno-error=deprecated-declarations -Wno-error=pointer-to-int-cast -fno-builtin -fsycl-device-lib-jit-link -o %t2.out -// RUN: %if !gpu %{ %{run} %t2.out %} +// RUN: %if target-spir %{ %{build} -Wno-error=deprecated-declarations -Wno-error=pointer-to-int-cast -fno-builtin -fsycl-device-lib-jit-link -o %t2.out %} +// RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include #include From 64ccf4d982bb6f502b96a48263ecbdeec9285c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Tue, 17 Jun 2025 19:34:01 +0200 Subject: [PATCH 3/4] Fix typo Co-authored-by: Alexey Bader --- sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp index 0349efaa75c26..692f2147e3632 100644 --- a/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp +++ b/sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t1.out // RUN: %{run} %t1.out -// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out %} +// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out // RUN: %{run} %t2.out // // UNSUPPORTED: target-nvidia || target-amd From 9bcddcddfa6d430d7273407cd22183b8bbe38da5 Mon Sep 17 00:00:00 2001 From: Gergely Meszaros Date: Tue, 17 Jun 2025 23:55:21 -0700 Subject: [PATCH 4/4] Remove duplicate `%s` from `%{build}` substitutions The expansion of `%{build}` already contains the file name of the test (`%s`), repeating it leads to duplicate symbol errors. --- sycl/test-e2e/DeviceLib/math_fp64_test.cpp | 2 +- sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp | 2 +- sycl/test-e2e/DeviceLib/math_windows_test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp index 9810e17b7afe1..c7c9c77aefed9 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_test.cpp @@ -7,7 +7,7 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} // RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" diff --git a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp index 4dca67bd959d9..06316e83ac5db 100644 --- a/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp @@ -5,7 +5,7 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} // RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp" diff --git a/sycl/test-e2e/DeviceLib/math_windows_test.cpp b/sycl/test-e2e/DeviceLib/math_windows_test.cpp index bf358f04e1e68..dce740d851c4b 100644 --- a/sycl/test-e2e/DeviceLib/math_windows_test.cpp +++ b/sycl/test-e2e/DeviceLib/math_windows_test.cpp @@ -7,7 +7,7 @@ // RUN: %{build} %{mathflags} -o %t1.out // RUN: %{run} %t1.out -// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} %s -o %t2.out %} +// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %} // RUN: %if target-spir && !gpu %{ %{run} %t2.out %} #include "math_utils.hpp"