Skip to content

Commit

Permalink
[SYCL][E2E] Fix warnings from using GNU style options with MSVC compi…
Browse files Browse the repository at this point in the history
…ler 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.
  • Loading branch information
ayylol authored Sep 11, 2024
1 parent 4152ed3 commit d3d9521
Show file tree
Hide file tree
Showing 39 changed files with 57 additions and 51 deletions.
8 changes: 4 additions & 4 deletions sycl/test-e2e/AOT/fpga-aoc-archive-early2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Build any image archive binaries from early archives.
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_sub.a -o %t_early_image_sub.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_add.a -o %t_early_image_add.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_sub_x.a -o %t_early_image_sub_x.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image %t_early_add_x.a -o %t_early_image_add_x.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_sub.a -o %t_early_image_sub.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_add.a -o %t_early_image_add.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_sub_x.a -o %t_early_image_sub_x.a
// RUN: %clangxx -fintelfpga -fsycl -fsycl-link=image -Wno-unused-command-line-argument %t_early_add_x.a -o %t_early_image_add_x.a
////////////////////////////////////////////////////////////////////////////////
// Use a variety of archive orders
////////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion sycl/test-e2e/BFloat16/bfloat16_vec_builtins.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %{build} -fno-fast-math -o %t.out
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
// RUN: %{build} %{mathflags} -o %t.out
// RUN: %{run} %t.out

// Test new, ABI-breaking for all platforms.
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/fpga_tests/fpga_aocx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// AOCX with source
// RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp %t_image.a -o %t_aocx_src.out
// AOCX with object
// RUN: %clangxx -fsycl -fintelfpga %t.o %t_image.a -o %t_aocx_obj.out
// RUN: %clangxx -fsycl -fintelfpga %t.o %t_image.a -Wno-unused-command-line-argument -o %t_aocx_obj.out
//
// RUN: %{run} %t_aocx_src.out
// RUN: %{run} %t_aocx_obj.out
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/fpga_tests/fpga_aocx_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// AOCX with source
// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out
// AOCX with object
// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out
// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -Wno-unused-command-line-argument -o %t_aocx_obj.out
//
// RUN: %{run} %t_aocx_src.out
// RUN: %{run} %t_aocx_obj.out
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/group_async_copy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -std=c++17 -o %t.run
// RUN: %{build} %cxx_std_optionc++17 -o %t.run
// RUN: %{run} %t.run

// Windows doesn't yet have full shutdown(). Skipping TC MemLeak tests.
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/group_async_copy_legacy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -std=c++17 -o %t.run -Wno-deprecated-declarations
// RUN: %{build} %cxx_std_optionc++17 -o %t.run -Wno-deprecated-declarations
// RUN: %{run} %t.run

// Variant of group_asymc_copy.cpp using legacy multi_ptr and the corresponding
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/group_local_id.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: cpu

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

#include <sycl/detail/core.hpp>
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/multisource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
// Separate kernel sources and host code sources
// RUN: %{build} -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -o %t.fat
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
// RUN: %{run} %t.fat

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

#include <sycl/detail/core.hpp>
Expand Down
6 changes: 3 additions & 3 deletions sycl/test-e2e/Basic/multisource_spv_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
// Separate kernel sources and host code sources
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -o %t.fat
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t.fat
// RUN: %{run} %t.fat

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

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

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/spirv_device_obj_smoke.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// UNSUPPORTED: cuda || hip
// RUN: %clangxx -fsycl -fsycl-device-obj=spirv -c -o %t.o %s
// RUN: %clangxx -fsycl -o %t.out %t.o
// RUN: %clangxx -fsycl -Wno-unused-command-line-argument -o %t.out %t.o
// RUN: %{run} %t.out

// This test verifies SPIR-V based fat objects.
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/vector/byte.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -std=c++17 -o %t.out
// RUN: %{build} %cxx_std_optionc++17 -o %t.out
// RUN: %{run} %t.out

// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -std=c++17 -o %t2.out %}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// RUN: %{build} %debug_option -O0 -o %t.out
// RUN: %{build} %debug_option %no_opt -o %t.out
// RUN: echo SYCL_PRINT_EXECUTION_GRAPH=always > %t.cfg
// RUN: env SYCL_CONFIG_FILE_NAME=%t.cfg %t.out
// RUN: cat *.dot > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/env_vars.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: opencl
// Env vars are used to pass OpenCL-specific flags to PI compiling/linking.
//
// RUN: %{build} -O0 -o %t.out
// RUN: %{build} %no_opt -o %t.out
//
// RUN: env SYCL_PROGRAM_COMPILE_OPTIONS="-g" %{run} %t.out
// RUN: env SYCL_PROGRAM_APPEND_COMPILE_OPTIONS="-g" %{run} %t.out
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/DeviceLib/separate_compile_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -Wno-sycl-strict %{mathflags}
// >> host compilation...
// RUN: %clangxx -Wno-error=unused-command-line-argument -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o %sycl_options -Wno-sycl-strict %{mathflags}
// RUN: %clangxx %t_host.o %t_device.o -o %t.out %sycl_options %{mathflags}
// RUN: %clangxx %t_host.o %t_device.o -Wno-unused-command-line-argument -o %t.out %sycl_options %{mathflags}
// RUN: %{run} %t.out

// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o %{mathflags}
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_fp64_test_ihdr.h %S/std_complex_math_fp64_test.cpp -Wno-sycl-strict %{mathflags}
// >> host compilation...
// RUN: %clangxx -Wno-error=unused-command-line-argument -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o %sycl_options -Wno-sycl-strict %{mathflags}
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out %sycl_options %{mathflags}
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -Wno-unused-command-line-argument -o %t_fp64.out %sycl_options %{mathflags}
// RUN: %{run} %t.out
4 changes: 2 additions & 2 deletions sycl/test-e2e/ESIMD/rotate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//

// RUN: %{build} -fsycl-device-code-split=per_kernel -std=c++20 -o %t.out
// RUN: %{build} -fsycl-device-code-split=per_kernel %cxx_std_optionc++20 -o %t.out
// RUN: %{run} %t.out
// RUN: %{build} -fsycl-device-code-split=per_kernel -std=c++20 -o %t1.out -DEXP
// RUN: %{build} -fsycl-device-code-split=per_kernel %cxx_std_optionc++20 -o %t1.out -DEXP
// RUN: %{run} %t1.out

// This is a basic test to validate the ror/rol functions.
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} -O0 -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// This is end-to-end test for the slm_allocator API used together with the
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc_many_kernels_many_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} -O0 -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// Checks validity of SLM frame offsets in case of complex call graph with two
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc_many_kernels_one_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} -O0 -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// Check that SLM frame offset of a function foo called from two kernels Test1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// RUN: %{build} -O0 -o %t_O0.out
// RUN: %{build} %no_opt -o %t_O0.out
// RUN: %{run} %t_O0.out

/*
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/HierPar/hier_par_wgscope_O0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// RUN: %{build} -O0 -o %t.out
// RUN: %{build} %no_opt -o %t.out

// RUN: %{run} %t.out

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// RUN: %{run} %t.out

// Test -O0 with `--offload-new-driver`
// RUN: %clangxx -O0 -fsycl -fsycl-targets=spir64-x86_64 %S/Inputs/aot.cpp
// RUN: %clangxx %no_opt -fsycl -fsycl-targets=spir64-x86_64 %S/Inputs/aot.cpp
// RUN: %{run} %t.out
2 changes: 1 addition & 1 deletion sycl/test-e2e/NewOffloadDriver/spirv_device_obj_smoke.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// UNSUPPORTED: cuda || hip
// Test with `--offload-new-driver`
// RUN: %clangxx -fsycl -fsycl-device-obj=spirv --offload-new-driver -c -o %t.o %s
// RUN: %clangxx -fsycl --offload-new-driver -o %t.out %t.o
// RUN: %clangxx -fsycl --offload-new-driver -Wno-unused-command-line-argument -o %t.out %t.o
// RUN: %{run} %t.out

// This test verifies SPIR-V based fat objects.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// requires: cpu, gpu, accelerator
// UNSUPPORTED: hip
// FIXME: enable the test back, see intel/llvm#8146
// RUN: %{build} -Wno-error=incorrect-sub-group-size -O0 -o %t.out
// RUN: %{build} -Wno-error=incorrect-sub-group-size %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} -DSOURCE1 -c -o %t1.o
// RUN: %{build} -DSOURCE2 -c -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -o %t.exe
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -Wno-unused-command-line-argument -o %t.exe
// RUN: %{run} %t.exe

#ifdef SOURCE1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: cpu

// RUN: %{build} -O0 -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ProgramManager/uneven_kernel_split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -I %S/Inputs/ %S/uneven_kernel_split.cpp -c -o %t.o
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts -I %S/Inputs/ %S/Inputs/gpu_kernel1.cpp -c -o %t1.o
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts -I %S/Inputs/ %S/Inputs/gpu_kernel2.cpp -c -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o %t1.o %t2.o -o %t.out
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts -Wno-unused-command-line-argument %t.o %t1.o %t2.o -o %t.out
// RUN: %{run} %t.out

// Test require the following device image structure: cpu target device image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: opencl

// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t0.out
// RUN: %{build} %no_opt -o %t0.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL0 %}
// RUN: %{build} -O1 -o %t1.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL1 %}
Expand All @@ -9,7 +9,7 @@
// RUN: %{build} -O3 -o %t3.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL3 %}

// RUN: %{build} -O0 -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

// This test verifies the propagation of front-end compiler optimization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %{build} -g -o %t.out
// RUN: %{build} -g -O0 -o %t.out
// RUN: %{build} -g %no_opt -o %t.out
// RUN: %{build} -g -O2 -o %t.out
//
// The idea of this test is to make sure that we can compile the following
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/DAE-separate-compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// The test checks that the scenario works correctly.
//
// RUN: %{build} -O2 -c -o %t.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.o -O0 -o %t.out
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.o %no_opt -Wno-unused-command-line-argument -o %t.out
// RUN: %{run} %t.out

// Failing on HIP AMD, enable after fixed
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/compile_on_win_with_mdd.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: windows

// RUN: %clangxx --driver-mode=cl -fsycl /MDd -c %s -o %t.obj
// RUN: %clangxx --driver-mode=cl -fsycl %t.obj -o %t.out
// RUN: %clangxx --driver-mode=cl -fsycl %t.obj -Wno-unused-command-line-argument -o %t.out
// RUN: %{run} %t.out

// The test aims to prevent regressions similar to the one which caused by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -O0 is necessary; on higher levels of optimization, an error
// would not occur because of dead argument elimination of the local_accessor.
// RUN: %{build} -o %t.out -O0
// RUN: %{build} -o %t.out %no_opt
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} %debug_option -O0 -o %t.out
// RUN: %{build} %debug_option %no_opt -o %t.out
// RUN: %{build} %debug_option -O1 -o %t.out
// RUN: %{build} %debug_option -O2 -o %t.out
// RUN: %{build} %debug_option -O3 -o %t.out
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// RUN: %{build} %debug_option -ffp-model=fast -o %t.out
// DEFINE: %{ffpflags} = %if cl_options %{/clang:-ffp-model=fast%} %else %{-ffp-model=fast%}
// DEFINE: %{Oz} = %if cl_options %{/clang:-Oz%} %else %{-Oz%}
// DEFINE: %{O} = %if cl_options %{/clang:-O%} %else %{-O%}
// RUN: %{build} %debug_option %{ffpflags} -o %t.out
// RUN: %{build} %debug_option -Os -o %t.out
// RUN: %{build} %debug_option -Oz -o %t.out
// RUN: %{build} %debug_option %{Oz} -o %t.out
// RUN: %{build} %debug_option -Og -o %t.out
// RUN: %{build} %debug_option -O -o %t.out
// RUN: %{build} %debug_option %{O} -o %t.out

// NOTE: Tests that debugging information can be generated for all special-name
// optimization levels.
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/unoptimized_stream.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -O0 -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/SeparateCompile/same-kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// RUN: %{build} -DB_CPP=1 -c -o %t-same-kernel-b.o
//
// >> ---- link the full hetero app
// RUN: %clangxx %t-same-kernel-a.o %t-same-kernel-b.o -o %t-same-kernel.exe -fsycl -fsycl-targets=%{sycl_triple}
// RUN: %clangxx %t-same-kernel-a.o %t-same-kernel-b.o -Wno-unused-command-line-argument -o %t-same-kernel.exe -fsycl -fsycl-targets=%{sycl_triple}
// RUN: %{run} %t-same-kernel.exe

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// RUN: %{build} -O3 -DSOURCE3 -c -o %t3.o
// RUN: rm -f %t.a
// RUN: llvm-ar crv %t.a %t1.o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t.a -o %t1.exe
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t.a -Wno-unused-command-line-argument -o %t1.exe
// RUN: %{run} %t1.exe

// Check the repacked case as it can behave differently.
// RUN: echo create %t_repacked.a > %t.txt
// RUN: echo addlib %t.a >> %t.txt
// RUN: echo save >> %t.txt
// RUN: cat %t.txt | llvm-ar -M
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t_repacked.a -o %t2.exe
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t_repacked.a -Wno-unused-command-line-argument -o %t2.exe
// RUN: %{run} %t2.exe

#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/SeparateCompile/sycl-external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// different object file.
// RUN: %{build} -DSOURCE1 -c -o %t1.o
// RUN: %{build} -DSOURCE2 -c -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -o %t.exe
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -Wno-unused-command-line-argument -o %t.exe
// RUN: %{run} %t.exe
//
// Test2 - check that kernel can call a SYCL_EXTERNAL function defined in a
// static library.
// RUN: rm -f %t.a
// RUN: llvm-ar crv %t.a %t1.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t2.o %t.a -o %t.exe
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t2.o %t.a -Wno-unused-command-line-argument -o %t.exe
// RUN: %{run} %t.exe

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/SeparateCompile/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// RUN: %clangxx -Wno-error=override-module -c wrapper.bc -o wrapper.o
//
// >> ---- link the full hetero app
// RUN: %clangxx wrapper.o a.o b.o -o app.exe %sycl_options
// RUN: %clangxx wrapper.o a.o b.o -Wno-unused-command-line-argument -o app.exe %sycl_options
// RUN: %{run} ./app.exe | FileCheck %s
// CHECK: pass

Expand Down
Loading

0 comments on commit d3d9521

Please sign in to comment.