Skip to content

Commit f0ee2da

Browse files
[SYCL][E2E] Fix failures on Windows (#16196)
`-isystem` flag is not supported by `clang-cl` which mimics `cl`. Therefore, extended `%sycl_include` substitution to already include OS-dependent version of `-isystem`. We don't really use SYCL headers as non-system headers in our E2E tests.
1 parent 772f3da commit f0ee2da

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

sycl/test-e2e/Basic/windows_version_agnostic_sycl_lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: windows
22
// REQUIRES: build-and-run-mode
33

4-
// RUN: %clangxx --driver-mode=cl /std:c++17 /EHsc /imsvc %sycl_include -I%opencl_include_dir %s -o %t.out /link /defaultlib:%sycl_static_libs_dir/sycl.lib
4+
// RUN: %clangxx --driver-mode=cl /std:c++17 /EHsc %sycl_include -I%opencl_include_dir %s -o %t.out /link /defaultlib:%sycl_static_libs_dir/sycl.lib
55
// RUN: %{run} %t.out
66

77
// This test checks that if program is linked with version-agnostic import library sycl.lib then sycl program works as expected.

sycl/test-e2e/Config/kernel_from_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// RUN: %if linux %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %t_asan.bc %} %else %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %}
1515
// >> ---- translate to SPIR-V
1616
// RUN: llvm-spirv -o %t.spv %t_app.bc
17-
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -fno-sycl-dead-args-optimization -Xclang -verify-ignore-unexpected=note,warning
17+
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -fno-sycl-dead-args-optimization -Xclang -verify-ignore-unexpected=note,warning
1818
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out | FileCheck %s
1919
// CHECK: Passed
2020

sycl/test-e2e/DeviceLib/separate_compile_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o %{mathflags}
44
// 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}
55
// >> host compilation...
6-
// RUN: %clangxx -Wno-error=unused-command-line-argument -isystem %sycl_include -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}
6+
// RUN: %clangxx -Wno-error=unused-command-line-argument %sycl_include -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}
77
// RUN: %clangxx %t_host.o %t_device.o -Wno-unused-command-line-argument -o %t.out %sycl_options %{mathflags}
88
// RUN: %{run} %t.out
99

1010
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o %{mathflags}
1111
// 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}
1212
// >> host compilation...
13-
// RUN: %clangxx -Wno-error=unused-command-line-argument -isystem %sycl_include -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}
13+
// RUN: %clangxx -Wno-error=unused-command-line-argument %sycl_include -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}
1414
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -Wno-unused-command-line-argument -o %t_fp64.out %sycl_options %{mathflags}
1515
// RUN: %{run} %t.out

sycl/test-e2e/SeparateCompile/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// >> device compilation...
99
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fno-sycl-dead-args-optimization -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_a.h %s -o a_kernel.bc -Wno-sycl-strict
1010
// >> host compilation...
11-
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
11+
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
1212
//
1313
// >> ---- compile src2
1414
// >> device compilation...
1515
// RUN: %clangxx -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 -fno-sycl-dead-args-optimization -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -o b_kernel.bc -Wno-sycl-strict
1616
// >> host compilation...
17-
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
17+
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
1818
//
1919
// >> ---- bundle .o with .spv
2020
// >> run bundler

sycl/test-e2e/lit.cfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@
149149
("%sycl_static_libs_dir", config.sycl_libs_dir + "/../lib")
150150
)
151151
config.substitutions.append(("%obj_ext", ".obj"))
152+
config.substitutions.append(
153+
("%sycl_include", "-Xclang -isystem -Xclang " + config.sycl_include)
154+
)
152155
elif platform.system() == "Linux":
153156
config.substitutions.append(("%sycl_static_libs_dir", config.sycl_libs_dir))
154157
config.substitutions.append(("%obj_ext", ".o"))
155-
config.substitutions.append(("%sycl_include", config.sycl_include))
158+
config.substitutions.append(("%sycl_include", "-isystem " + config.sycl_include))
156159

157160
# Intel GPU FAMILY availability
158161
if lit_config.params.get("gpu-intel-gen11", False):

0 commit comments

Comments
 (0)