Skip to content

Commit d3d9521

Browse files
authored
[SYCL][E2E] Fix warnings from using GNU style options with MSVC compiler driver (#15364)
Due to the addition of the `-Werror` flag, these warnings were causing test failures when compiling tests with clang-cl. This patch does the following: - Add `-Wno-unused-command-line-argument` to linking run lines. This is needed because when testing the MSVC driver the `/EHsc` flag is added to all run lines that call the compiler. This flag however is only needed at the compile stage so it is reported as unused if a run line is only linking. - Add new expansion for no optimizations `%no_opt`, which is either `-O0` or `/Od` depending on the compiler driver. - Use the expansion `%cxx_std_option` in place of `-std=` - For flags that do not necessarily have an MSVC equivalent, prepend `/clang:` to the flag when using MSVC driver.
1 parent 4152ed3 commit d3d9521

39 files changed

+57
-51
lines changed

sycl/test-e2e/AOT/fpga-aoc-archive-early2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
////////////////////////////////////////////////////////////////////////////////
1919
////////////////////////////////////////////////////////////////////////////////
2020
// Build any image archive binaries from early archives.
21-
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_sub.a -o %t_early_image_sub.a
22-
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_add.a -o %t_early_image_add.a
23-
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_sub_x.a -o %t_early_image_sub_x.a
24-
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_add_x.a -o %t_early_image_add_x.a
21+
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_sub.a -o %t_early_image_sub.a
22+
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_add.a -o %t_early_image_add.a
23+
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_sub_x.a -o %t_early_image_sub_x.a
24+
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_add_x.a -o %t_early_image_add_x.a
2525
////////////////////////////////////////////////////////////////////////////////
2626
// Use a variety of archive orders
2727
////////////////////////////////////////////////////////////////////////////////

sycl/test-e2e/BFloat16/bfloat16_vec_builtins.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %{build} -fno-fast-math -o %t.out
1+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
2+
// RUN: %{build} %{mathflags} -o %t.out
23
// RUN: %{run} %t.out
34

45
// Test new, ABI-breaking for all platforms.

sycl/test-e2e/Basic/fpga_tests/fpga_aocx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// AOCX with source
2121
// RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp %t_image.a -o %t_aocx_src.out
2222
// AOCX with object
23-
// RUN: %clangxx -fsycl -fintelfpga %t.o %t_image.a -o %t_aocx_obj.out
23+
// RUN: %clangxx -fsycl -fintelfpga %t.o %t_image.a -Wno-unused-command-line-argument -o %t_aocx_obj.out
2424
//
2525
// RUN: %{run} %t_aocx_src.out
2626
// RUN: %{run} %t_aocx_obj.out

sycl/test-e2e/Basic/fpga_tests/fpga_aocx_win.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// AOCX with source
2222
// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out
2323
// AOCX with object
24-
// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out
24+
// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -Wno-unused-command-line-argument -o %t_aocx_obj.out
2525
//
2626
// RUN: %{run} %t_aocx_src.out
2727
// RUN: %{run} %t_aocx_obj.out

sycl/test-e2e/Basic/group_async_copy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -std=c++17 -o %t.run
1+
// RUN: %{build} %cxx_std_optionc++17 -o %t.run
22
// RUN: %{run} %t.run
33

44
// Windows doesn't yet have full shutdown(). Skipping TC MemLeak tests.

sycl/test-e2e/Basic/group_async_copy_legacy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -std=c++17 -o %t.run -Wno-deprecated-declarations
1+
// RUN: %{build} %cxx_std_optionc++17 -o %t.run -Wno-deprecated-declarations
22
// RUN: %{run} %t.run
33

44
// Variant of group_asymc_copy.cpp using legacy multi_ptr and the corresponding

sycl/test-e2e/Basic/group_local_id.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: cpu
22

3-
// RUN: %{build} -std=c++17 -o %t.out
3+
// RUN: %{build} %cxx_std_optionc++17 -o %t.out
44
// RUN: %{run} %t.out
55

66
#include <sycl/detail/core.hpp>

sycl/test-e2e/Basic/multisource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// Separate kernel sources and host code sources
1010
// RUN: %{build} -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
1111
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
12-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -o %t.fat
12+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
1313
// RUN: %{run} %t.fat
1414

1515
// Multiple sources with kernel code
1616
// RUN: %{build} -c -o %t.init.o -DINIT_KERNEL
1717
// RUN: %{build} -c -o %t.calc.o -DCALC_KERNEL
1818
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
19-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -o %t.fat
19+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
2020
// RUN: %{run} %t.fat
2121

2222
#include <sycl/detail/core.hpp>

sycl/test-e2e/Basic/multisource_spv_obj.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111
// Separate kernel sources and host code sources
1212
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
1313
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.main.o -DMAIN_APP
14-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -o %t.fat
14+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
1515
// RUN: %{run} %t.fat
1616

1717
// Multiple sources with kernel code
1818
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.init.o -DINIT_KERNEL
1919
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.calc.o -DCALC_KERNEL
2020
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.main.o -DMAIN_APP
21-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -o %t.fat
21+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
2222
// RUN: %{run} %t.fat
2323

2424
// Multiple sources with kernel code, mixed SPIR-V and LLVM-IR objects
2525
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.init.o -DINIT_KERNEL
2626
// RUN: %{build} -fsycl-device-obj=llvmir -c -o %t.calc.o -DCALC_KERNEL
2727
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
28-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -o %t.fat
28+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
2929
// RUN: %{run} %t.fat
3030

3131
#include <sycl/detail/core.hpp>

sycl/test-e2e/Basic/spirv_device_obj_smoke.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// UNSUPPORTED: cuda || hip
22
// RUN: %clangxx -fsycl -fsycl-device-obj=spirv -c -o %t.o %s
3-
// RUN: %clangxx -fsycl -o %t.out %t.o
3+
// RUN: %clangxx -fsycl -Wno-unused-command-line-argument -o %t.out %t.o
44
// RUN: %{run} %t.out
55

66
// This test verifies SPIR-V based fat objects.

0 commit comments

Comments
 (0)