From 0f8f4811dde4f72a6daa09ecf15059f63d755b8f Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 16 Jun 2021 18:37:15 +0300 Subject: [PATCH 1/5] [SYCL] Refactor LIT tests for diagnostics Added `-fsycl-device-only` to ESIMD-specific tests. Added `%fsycl-host-only` substitution, which contains a minimal amount of compiler arguments needed to only perform SYCL source compilation in host mode. Updated SYCL LIT tests checking diagnostics for host APIs to use that new substitution. This patch is motivated by a few of things: - enabling integration footer unconditionally in intel/llvm#3777 - the fact that `-verify` is intended to be used with `clang -cc1` - the fact that `VerifyDiagnosticConsumer` doesn't handle (or maybe not even designed to) line markers in input file All those things lead to LIT failures, because `-verify` is not able to properly read diagnostic messages emitted by FE invocation for host part of DPC++/SYCL programs and reports that some diagnostics are either "seen, but not expected" or "expected, but not seen". Note: diagnostic messages themself look just fine and correct when observed through `clang -fsycl`, `clang -cc1 -fsycl-device-only` and `clang -cc1 -fsycl-is-host` invocations. Besides resolving/avoiding those issues, this PR should speed up those LIT tests, because of reduced amount of FE invocations. Change to ESIMD-specific tests is debatable, because we now do not check diagnostics coming from the host compilation pass. Hopefully, this is not a huge problem, because: - ESIMD APIs don't seem to be usable on host - device compilation is a first phase in our toolchain so, diagnostics in shared code should still be tested with this change - it is expected for API endpoints to have the same requirements/arguments/return types/deprecation notices between host and device, which means that tests for those things can only be performed for either device or host and duplication could be avoided --- sycl/test/CMakeLists.txt | 2 +- sycl/test/basic_tests/image_accessor_types.cpp | 8 +++----- .../basic_tests/implicit_conversion_error.cpp | 10 ++-------- sycl/test/basic_tests/range_error.cpp | 15 +++++---------- sycl/test/basic_tests/set_arg_error.cpp | 2 +- sycl/test/basic_tests/vectors/ctad_fail.cpp | 9 +-------- sycl/test/esimd/enums.cpp | 2 +- sycl/test/esimd/flat_atomic.cpp | 2 +- sycl/test/esimd/gather4_scatter4.cpp | 2 +- sycl/test/esimd/simd_copy_to_copy_from.cpp | 4 ++-- sycl/test/esimd/simd_subscript.cpp | 2 +- sycl/test/esimd/slm_atomic.cpp | 2 +- sycl/test/esimd/slm_load4.cpp | 2 +- sycl/test/gdb/accessors.cpp | 2 +- sycl/test/gdb/printers.cpp | 2 +- sycl/test/lit.cfg.py | 2 ++ sycl/test/separate-compile/test.cpp | 4 ++-- sycl/test/warnings/sycl_2020_deprecations.cpp | 6 ++---- 18 files changed, 29 insertions(+), 49 deletions(-) diff --git a/sycl/test/CMakeLists.txt b/sycl/test/CMakeLists.txt index a2a12c8797a76..d8b8e02ae7d63 100644 --- a/sycl/test/CMakeLists.txt +++ b/sycl/test/CMakeLists.txt @@ -2,7 +2,7 @@ set(LLVM_TOOLS_DIR "${LLVM_BINARY_DIR}/bin/") get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR) -set(SYCL_INCLUDE "${SYCL_INCLUDE_BUILD_DIR}") +set(SYCL_INCLUDE "${SYCL_INCLUDE_BUILD_DIR}/sycl/") set(SYCL_TOOLS_SRC_DIR "${PROJECT_SOURCE_DIR}/tools/") set(LLVM_BUILD_BINARY_DIRS "${LLVM_BINARY_DIR}/bin/") set(LLVM_BUILD_LIBRARY_DIRS "${LLVM_BINARY_DIR}/lib/") diff --git a/sycl/test/basic_tests/image_accessor_types.cpp b/sycl/test/basic_tests/image_accessor_types.cpp index 5bcdc22357295..6abbca5851896 100644 --- a/sycl/test/basic_tests/image_accessor_types.cpp +++ b/sycl/test/basic_tests/image_accessor_types.cpp @@ -1,4 +1,4 @@ -// RUN: not %clangxx -fsyntax-only -std=c++17 %s -I %sycl_include/sycl 2>&1 | FileCheck %s +// RUN: %clangxx -fsyntax-only %fsycl-host-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include @@ -12,12 +12,10 @@ int main() { myQueue.submit([&](handler &cgh) { accessor NotValidType1( srcImage, cgh); - // CHECK: The data type of an image accessor must be only cl_int4, cl_uint4, - // CHECK-SAME: cl_float4 or cl_half4 + // expected-error@CL/sycl/accessor.hpp:* {{The data type of an image accessor must be only cl_int4, cl_uint4, cl_float4 or cl_half4}} accessor NotValidType2( srcImage, cgh); - // CHECK: The data type of an image accessor must be only cl_int4, cl_uint4, - // CHECK-SAME: cl_float4 or cl_half4 + // expected-error@CL/sycl/accessor.hpp:* {{The data type of an image accessor must be only cl_int4, cl_uint4, cl_float4 or cl_half4}} accessor ValidSYCLFloat(srcImage, cgh); accessor ValidSYCLInt( diff --git a/sycl/test/basic_tests/implicit_conversion_error.cpp b/sycl/test/basic_tests/implicit_conversion_error.cpp index 6b4b389c45f70..2cf5325a08d48 100644 --- a/sycl/test/basic_tests/implicit_conversion_error.cpp +++ b/sycl/test/basic_tests/implicit_conversion_error.cpp @@ -1,11 +1,5 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=note,warning -//=- implicit_conversion_error.cpp - Unintended implicit conversion check -=// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------------===// +// RUN: %clangxx -fsyntax-only %fsycl-host-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s + #include int main() { diff --git a/sycl/test/basic_tests/range_error.cpp b/sycl/test/basic_tests/range_error.cpp index c11d2242119c4..2aed44d9eb7ca 100644 --- a/sycl/test/basic_tests/range_error.cpp +++ b/sycl/test/basic_tests/range_error.cpp @@ -1,11 +1,4 @@ -// RUN: %clangxx -fsycl -Xclang -verify %s -Xclang -verify-ignore-unexpected=note,warning -fsyntax-only -//==--------------- range_error.cpp - SYCL range error test ----------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// +// RUN: %clangxx %s %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning #include #include #include @@ -33,6 +26,8 @@ int main() { assert(three_dim_range.get(2) ==2); assert(three_dim_range[2] ==2); cout << "three_dim_range passed " << endl; - cl::sycl::range<1> one_dim_range_f1(64, 2, 4);//expected-error {{no matching constructor for initialization of 'cl::sycl::range<1>'}} - cl::sycl::range<2> two_dim_range_f1(64);//expected-error {{no matching constructor for initialization of 'cl::sycl::range<2>'}} + // expected-error@+1 {{no matching constructor for initialization of 'cl::sycl::range<1>'}} + cl::sycl::range<1> one_dim_range_f1(64, 2, 4); + // expected-error@+1 {{no matching constructor for initialization of 'cl::sycl::range<2>'}} + cl::sycl::range<2> two_dim_range_f1(64); } diff --git a/sycl/test/basic_tests/set_arg_error.cpp b/sycl/test/basic_tests/set_arg_error.cpp index d4215766c7a56..c7ea5be42808e 100644 --- a/sycl/test/basic_tests/set_arg_error.cpp +++ b/sycl/test/basic_tests/set_arg_error.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -Xclang -verify %s -I %sycl_include -Xclang -verify-ignore-unexpected=note,warning -fsyntax-only +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s #include diff --git a/sycl/test/basic_tests/vectors/ctad_fail.cpp b/sycl/test/basic_tests/vectors/ctad_fail.cpp index bdae6b013e62c..b584cebb698d0 100644 --- a/sycl/test/basic_tests/vectors/ctad_fail.cpp +++ b/sycl/test/basic_tests/vectors/ctad_fail.cpp @@ -1,11 +1,4 @@ -// RUN: %clangxx -std=c++17 -fsyntax-only -Xclang -verify %s -I %sycl_include/sycl -Xclang -verify-ignore-unexpected -//==--------------- ctad.cpp - SYCL vector CTAD fail test ------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected %s #include namespace sycl = cl::sycl; diff --git a/sycl/test/esimd/enums.cpp b/sycl/test/esimd/enums.cpp index 0f686d1038043..d91ea11579bb6 100644 --- a/sycl/test/esimd/enums.cpp +++ b/sycl/test/esimd/enums.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s // This test checks compilation of various ESIMD enum types. Those which are // deprecated must produce deprecation messages. diff --git a/sycl/test/esimd/flat_atomic.cpp b/sycl/test/esimd/flat_atomic.cpp index 86a1800ca2158..22499835b72cd 100644 --- a/sycl/test/esimd/flat_atomic.cpp +++ b/sycl/test/esimd/flat_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s // This test checks compilation of ESIMD atomic APIs. Those which are deprecated // must produce deprecation messages. diff --git a/sycl/test/esimd/gather4_scatter4.cpp b/sycl/test/esimd/gather4_scatter4.cpp index 31fb3ee241a4f..5e1ec851c0046 100644 --- a/sycl/test/esimd/gather4_scatter4.cpp +++ b/sycl/test/esimd/gather4_scatter4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s // This test checks compilation of ESIMD slm gather4/scatter4 APIs. Those which // are deprecated must produce deprecation messages. diff --git a/sycl/test/esimd/simd_copy_to_copy_from.cpp b/sycl/test/esimd/simd_copy_to_copy_from.cpp index 360c5c3fdc28a..40f077da3631c 100644 --- a/sycl/test/esimd/simd_copy_to_copy_from.cpp +++ b/sycl/test/esimd/simd_copy_to_copy_from.cpp @@ -1,6 +1,6 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s -// This test checks that both host and device compilers can: +// This test checks that device compiler can: // - successfully compile simd::copy_to and simd::copy_from APIs // - emit an error if argument of an incompatible type is used // in place of the accessor argument diff --git a/sycl/test/esimd/simd_subscript.cpp b/sycl/test/esimd/simd_subscript.cpp index 35f90c231377f..8bd24fc182b74 100644 --- a/sycl/test/esimd/simd_subscript.cpp +++ b/sycl/test/esimd/simd_subscript.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s #include diff --git a/sycl/test/esimd/slm_atomic.cpp b/sycl/test/esimd/slm_atomic.cpp index fce324854a6e4..e74ddc2cda598 100644 --- a/sycl/test/esimd/slm_atomic.cpp +++ b/sycl/test/esimd/slm_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s // This test checks compilation of ESIMD slm atomic APIs. Those which are // deprecated must produce deprecation messages. diff --git a/sycl/test/esimd/slm_load4.cpp b/sycl/test/esimd/slm_load4.cpp index 163c06010c89c..fadaa0ced6e72 100644 --- a/sycl/test/esimd/slm_load4.cpp +++ b/sycl/test/esimd/slm_load4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s // This test checks compilation of ESIMD slm load4/store4 APIs. Those which are // deprecated must produce deprecation messages. diff --git a/sycl/test/gdb/accessors.cpp b/sycl/test/gdb/accessors.cpp index da7cc84ecb2ea..adc8fb369a222 100644 --- a/sycl/test/gdb/accessors.cpp +++ b/sycl/test/gdb/accessors.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -Xclang -ast-dump %s | FileCheck %s +// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include -Xclang -ast-dump %s | FileCheck %s // UNSUPPORTED: windows #include diff --git a/sycl/test/gdb/printers.cpp b/sycl/test/gdb/printers.cpp index 58fda0db57034..fe81f9892cf9c 100644 --- a/sycl/test/gdb/printers.cpp +++ b/sycl/test/gdb/printers.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -Xclang -ast-dump %s | FileCheck %s +// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include -Xclang -ast-dump %s | FileCheck %s // UNSUPPORTED: windows #include #include diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index b41a369aa90f6..2131d64ffabd4 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -90,6 +90,8 @@ config.substitutions.append( ('%llvm_build_lib_dir', config.llvm_build_lib_dir ) ) config.substitutions.append( ('%llvm_build_bin_dir', config.llvm_build_bin_dir ) ) +config.substitutions.append( ('%fsycl-host-only', '-std=c++17 -Xclang -fsycl-is-host -isystem %s -isystem %s' % (config.sycl_include, config.opencl_include_dir) ) ) + llvm_config.add_tool_substitutions(['llvm-spirv'], [config.sycl_tools_dir]) config.substitutions.append( ('%RUN_ON_HOST', "env SYCL_DEVICE_FILTER=host ") ) diff --git a/sycl/test/separate-compile/test.cpp b/sycl/test/separate-compile/test.cpp index df97ae177d5d1..30e58f50aee9b 100644 --- a/sycl/test/separate-compile/test.cpp +++ b/sycl/test/separate-compile/test.cpp @@ -7,13 +7,13 @@ // >> host compilation... // Driver automatically adds -D_DLL and -D_MT on Windows with -fsycl. // Add those defines required for Windows and harmless for Linux. -// RUN: %clangxx -D_DLL -D_MT -std=c++17 -include sycl_ihdr_a.h -g -c %s -o a.o -I %sycl_include/sycl -Wno-sycl-strict +// RUN: %clangxx -D_DLL -D_MT -std=c++17 -include sycl_ihdr_a.h -g -c %s -o a.o -I %sycl_include -Wno-sycl-strict // // >> ---- compile src2 // >> device compilation... // RUN: %clangxx -DB_CPP=1 -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -c -o b_kernel.bc -Wno-sycl-strict // >> host compilation... -// RUN: %clangxx -DB_CPP=1 -D_DLL -D_MT -std=c++17 -include sycl_ihdr_b.h -g -c %s -o b.o -I %sycl_include/sycl -Wno-sycl-strict +// RUN: %clangxx -DB_CPP=1 -D_DLL -D_MT -std=c++17 -include sycl_ihdr_b.h -g -c %s -o b.o -I %sycl_include -Wno-sycl-strict // // >> ---- bundle .o with .spv // >> run bundler diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 5e159afa496cd..023b4b9d9f905 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -1,7 +1,5 @@ -// RUN: %clangxx -fsycl -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out -// RUN: %clangxx -fsycl -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out -// RUN: %clangxx -fsycl -sycl-std=2017 -Werror %s -o %t.out -// RUN: %clangxx -fsycl -sycl-std=1.2.1 -Werror %s -o %t.out +// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out +// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out #include From 118ec382ffcb5d04ae1bf317e705024f875591bd Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Mon, 21 Jun 2021 15:28:05 +0300 Subject: [PATCH 2/5] Apply review comments Returned host compiler invocation to some tests, but in order to do so I had to switch them to use `FileCheck` instead of `-verify` as the latter won't work with host code anymore once we enable integration footer. --- sycl/test/CMakeLists.txt | 2 +- .../test/basic_tests/image_accessor_types.cpp | 1 + sycl/test/esimd/enums.cpp | 33 +++++++++++++------ sycl/test/esimd/flat_atomic.cpp | 23 +++++++++---- sycl/test/esimd/gather4_scatter4.cpp | 29 +++++++++++----- sycl/test/esimd/simd_copy_to_copy_from.cpp | 21 ++++-------- sycl/test/esimd/simd_subscript.cpp | 3 +- sycl/test/esimd/slm_atomic.cpp | 23 +++++++++---- sycl/test/esimd/slm_load4.cpp | 17 +++++++--- sycl/test/gdb/accessors.cpp | 2 +- sycl/test/gdb/printers.cpp | 2 +- sycl/test/lit.cfg.py | 2 +- sycl/test/separate-compile/test.cpp | 4 +-- sycl/test/warnings/sycl_2020_deprecations.cpp | 2 ++ 14 files changed, 105 insertions(+), 59 deletions(-) diff --git a/sycl/test/CMakeLists.txt b/sycl/test/CMakeLists.txt index d8b8e02ae7d63..a2a12c8797a76 100644 --- a/sycl/test/CMakeLists.txt +++ b/sycl/test/CMakeLists.txt @@ -2,7 +2,7 @@ set(LLVM_TOOLS_DIR "${LLVM_BINARY_DIR}/bin/") get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR) -set(SYCL_INCLUDE "${SYCL_INCLUDE_BUILD_DIR}/sycl/") +set(SYCL_INCLUDE "${SYCL_INCLUDE_BUILD_DIR}") set(SYCL_TOOLS_SRC_DIR "${PROJECT_SOURCE_DIR}/tools/") set(LLVM_BUILD_BINARY_DIRS "${LLVM_BINARY_DIR}/bin/") set(LLVM_BUILD_LIBRARY_DIRS "${LLVM_BINARY_DIR}/lib/") diff --git a/sycl/test/basic_tests/image_accessor_types.cpp b/sycl/test/basic_tests/image_accessor_types.cpp index 6abbca5851896..4133d75954444 100644 --- a/sycl/test/basic_tests/image_accessor_types.cpp +++ b/sycl/test/basic_tests/image_accessor_types.cpp @@ -1,4 +1,5 @@ // RUN: %clangxx -fsyntax-only %fsycl-host-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s +// RUN: %clangxx -fsyntax-only -fsycl -fsycl-device-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s #include #include diff --git a/sycl/test/esimd/enums.cpp b/sycl/test/esimd/enums.cpp index d91ea11579bb6..d0a5b57dcfd8e 100644 --- a/sycl/test/esimd/enums.cpp +++ b/sycl/test/esimd/enums.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s // This test checks compilation of various ESIMD enum types. Those which are // deprecated must produce deprecation messages. @@ -8,21 +8,34 @@ using namespace sycl::ext::intel::experimental::esimd; void foo() SYCL_ESIMD_FUNCTION { - // These should produce deprecation messages: + // These should produce deprecation messages for both device: int x; - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: enums.cpp:15{{.*}}warning: 'WAIT' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(ESIMD_SBARRIER_WAIT); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: enums.cpp:18{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(EsimdAtomicOpType::ATOMIC_ADD); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: enums.cpp:21{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(ChannelMaskType::ESIMD_R_ENABLE); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: enums.cpp:24{{.*}}warning: 'GENX_NOSAT' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(GENX_NOSAT); + // A "border" between host and device compilations + // CHECK-LABEL: 4 warnings generated + + // And for host: + // CHECK: enums.cpp:15{{.*}}warning: 'WAIT' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: + // CHECK: enums.cpp:18{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: + // CHECK: enums.cpp:21{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: + // CHECK: enums.cpp:24{{.*}}warning: 'GENX_NOSAT' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: + // These should compile cleanly: x = static_cast(split_barrier_action::wait); x = static_cast(atomic_op::add); diff --git a/sycl/test/esimd/flat_atomic.cpp b/sycl/test/esimd/flat_atomic.cpp index 22499835b72cd..5a749789b5e9d 100644 --- a/sycl/test/esimd/flat_atomic.cpp +++ b/sycl/test/esimd/flat_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s // This test checks compilation of ESIMD atomic APIs. Those which are deprecated // must produce deprecation messages. @@ -15,8 +15,8 @@ void kernel0(accessor &buf) SYCL_ESIMD_FUNCTION { simd offsets(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: flat_atomic.cpp:20{{.*}}warning: 'ATOMIC_INC' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: flat_atomic(buf.get_pointer(), offsets, 1); flat_atomic(buf.get_pointer(), offsets, 1); } @@ -26,8 +26,8 @@ void kernel1(accessor offsets(0, 1); simd v1(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: flat_atomic.cpp:31{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: flat_atomic(buf.get_pointer(), offsets, v1, 1); flat_atomic(buf.get_pointer(), offsets, v1, 1); } @@ -37,9 +37,18 @@ void kernel2(accessor offsets(0, 1); simd v1(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: flat_atomic.cpp:42{{.*}}warning: 'ATOMIC_CMPXCHG' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: flat_atomic(buf.get_pointer(), offsets, v1, v1, 1); flat_atomic(buf.get_pointer(), offsets, v1, v1, 1); } + +// A "border" between device and host compilations +// CHECK-LABEL: 3 warnings generated +// CHECK: flat_atomic.cpp:20{{.*}}warning: 'ATOMIC_INC' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: flat_atomic.cpp:31{{.*}}warning: 'ATOMIC_ADD' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: flat_atomic.cpp:42{{.*}}warning: 'ATOMIC_CMPXCHG' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: diff --git a/sycl/test/esimd/gather4_scatter4.cpp b/sycl/test/esimd/gather4_scatter4.cpp index 5e1ec851c0046..5328a6faed74a 100644 --- a/sycl/test/esimd/gather4_scatter4.cpp +++ b/sycl/test/esimd/gather4_scatter4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s // This test checks compilation of ESIMD slm gather4/scatter4 APIs. Those which // are deprecated must produce deprecation messages. @@ -16,23 +16,34 @@ void kernel(accessor offsets(0, 1); simd v1(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: gather4_scatter4.cpp:21{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: auto v0 = gather4(buf.get_pointer(), offsets); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: gather4_scatter4.cpp:24{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: v0 = gather4(buf.get_pointer(), offsets); v0 = gather4(buf.get_pointer(), offsets); v0 = v0 + v1; - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: gather4_scatter4.cpp:32{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: scatter4(buf.get_pointer(), v0, offsets); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: gather4_scatter4.cpp:35{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: scatter4(buf.get_pointer(), v0, offsets); scatter4(buf.get_pointer(), v0, offsets); } + +// A "border" between host and device compilations +// CHECK-LABEL: 4 warnings generated +// CHECK: gather4_scatter4.cpp:21{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: gather4_scatter4.cpp:24{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: gather4_scatter4.cpp:32{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: gather4_scatter4.cpp:35{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: diff --git a/sycl/test/esimd/simd_copy_to_copy_from.cpp b/sycl/test/esimd/simd_copy_to_copy_from.cpp index 40f077da3631c..13f4e05c5c794 100644 --- a/sycl/test/esimd/simd_copy_to_copy_from.cpp +++ b/sycl/test/esimd/simd_copy_to_copy_from.cpp @@ -1,6 +1,7 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: not %clangxx -fsycl -fsycl-device-only -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: not %clangxx %fsycl-host-only -fsyntax-only %s 2>&1 | FileCheck %s -// This test checks that device compiler can: +// This test checks that device and host compilers can: // - successfully compile simd::copy_to and simd::copy_from APIs // - emit an error if argument of an incompatible type is used // in place of the accessor argument @@ -41,14 +42,10 @@ kernel3(accessor &buf) SYCL_ESIMD_FUNCTION { simd v1(0, 1); simd v0; - // expected-error@+3 {{no matching member function for call to 'copy_from'}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} + // CHECK: simd_copy_to_copy_from.cpp:46{{.*}}error: no matching member function for call to 'copy_from' v0.copy_from(buf, 0); v0 = v0 + v1; - // expected-error@+3 {{no matching member function for call to 'copy_to'}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} + // CHECK: simd_copy_to_copy_from.cpp:49{{.*}}error: no matching member function for call to 'copy_to' v0.copy_to(buf, 0); } @@ -57,9 +54,7 @@ SYCL_EXTERNAL void kernel4( accessor &buf) SYCL_ESIMD_FUNCTION { simd v; - // expected-error@+3 {{no matching member function for call to 'copy_from'}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} + // CHECK: simd_copy_to_copy_from.cpp:58{{.*}}error: no matching member function for call to 'copy_from' v.copy_from(buf, 0); } @@ -68,8 +63,6 @@ SYCL_EXTERNAL void kernel5( accessor &buf) SYCL_ESIMD_FUNCTION { simd v(0, 1); - // expected-error@+3 {{no matching member function for call to 'copy_to'}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} - // expected-note@sycl/ext/intel/experimental/esimd/simd.hpp:* {{}} + // CHECK: simd_copy_to_copy_from.cpp:67{{.*}}error: no matching member function for call to 'copy_to' v.copy_to(buf, 0); } diff --git a/sycl/test/esimd/simd_subscript.cpp b/sycl/test/esimd/simd_subscript.cpp index 8bd24fc182b74..6f5139388235f 100644 --- a/sycl/test/esimd/simd_subscript.cpp +++ b/sycl/test/esimd/simd_subscript.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: not %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s #include @@ -68,6 +68,7 @@ void test_simd_writable_subscript() SYCL_ESIMD_FUNCTION { void test_simd_const_subscript() SYCL_ESIMD_FUNCTION { const simd cv = 1; int val2 = cv[0]; // returns int instead of simd_view + // CHECK: simd_subscript.cpp:72{{.*}}error: expression is not assignable cv[1] = 0; // expected-error {{expression is not assignable}} } diff --git a/sycl/test/esimd/slm_atomic.cpp b/sycl/test/esimd/slm_atomic.cpp index e74ddc2cda598..b8a0238e57633 100644 --- a/sycl/test/esimd/slm_atomic.cpp +++ b/sycl/test/esimd/slm_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s // This test checks compilation of ESIMD slm atomic APIs. Those which are // deprecated must produce deprecation messages. @@ -14,8 +14,8 @@ using namespace cl::sycl; void kernel0() SYCL_ESIMD_FUNCTION { simd offsets(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: slm_atomic.cpp:19{{.*}}warning: 'ATOMIC_INC' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: slm_atomic(offsets, 1); slm_atomic(offsets, 1); } @@ -24,8 +24,8 @@ void kernel1() SYCL_ESIMD_FUNCTION { simd offsets(0, 1); simd v1(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: slm_atomic.cpp:29{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: slm_atomic(offsets, v1, 1); slm_atomic(offsets, v1, 1); } @@ -34,8 +34,17 @@ void kernel2() SYCL_ESIMD_FUNCTION { simd offsets(0, 1); simd v1(0, 1); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: slm_atomic.cpp:39{{.*}}warning: 'ATOMIC_CMPXCHG' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: slm_atomic(offsets, v1, v1, 1); slm_atomic(offsets, v1, v1, 1); } + +// A "border" between device and host compilations +// CHECK-LABEL: 3 warnings generated +// CHECK: slm_atomic.cpp:19{{.*}}warning: 'ATOMIC_INC' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: slm_atomic.cpp:29{{.*}}warning: 'ATOMIC_ADD' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: +// CHECK: slm_atomic.cpp:39{{.*}}warning: 'ATOMIC_CMPXCHG' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: diff --git a/sycl/test/esimd/slm_load4.cpp b/sycl/test/esimd/slm_load4.cpp index fadaa0ced6e72..4684dff34be10 100644 --- a/sycl/test/esimd/slm_load4.cpp +++ b/sycl/test/esimd/slm_load4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s // This test checks compilation of ESIMD slm load4/store4 APIs. Those which are // deprecated must produce deprecation messages. @@ -14,15 +14,22 @@ void caller() SYCL_ESIMD_FUNCTION { slm_init(1024); - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: slm_load4.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note: auto v0 = slm_load4(offsets); v0 = slm_load4(offsets); v0 = v0 + v1; - // expected-warning@+2 {{deprecated}} - // expected-note@sycl/ext/intel/experimental/esimd/common.hpp:* {{}} + // CHECK: slm_load4.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated + // CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note: slm_store4(v0, offsets); slm_store4(v0, offsets); } + +// A "border" between host and device compilations +// CHECK-LABEL: 2 warnings generated +// CHECK: slm_load4.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note: +// CHECK: slm_load4.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated +// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note: diff --git a/sycl/test/gdb/accessors.cpp b/sycl/test/gdb/accessors.cpp index adc8fb369a222..da7cc84ecb2ea 100644 --- a/sycl/test/gdb/accessors.cpp +++ b/sycl/test/gdb/accessors.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include -Xclang -ast-dump %s | FileCheck %s +// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -Xclang -ast-dump %s | FileCheck %s // UNSUPPORTED: windows #include diff --git a/sycl/test/gdb/printers.cpp b/sycl/test/gdb/printers.cpp index fe81f9892cf9c..58fda0db57034 100644 --- a/sycl/test/gdb/printers.cpp +++ b/sycl/test/gdb/printers.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include -Xclang -ast-dump %s | FileCheck %s +// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -Xclang -ast-dump %s | FileCheck %s // UNSUPPORTED: windows #include #include diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index 2131d64ffabd4..70b09741b2df5 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -90,7 +90,7 @@ config.substitutions.append( ('%llvm_build_lib_dir', config.llvm_build_lib_dir ) ) config.substitutions.append( ('%llvm_build_bin_dir', config.llvm_build_bin_dir ) ) -config.substitutions.append( ('%fsycl-host-only', '-std=c++17 -Xclang -fsycl-is-host -isystem %s -isystem %s' % (config.sycl_include, config.opencl_include_dir) ) ) +config.substitutions.append( ('%fsycl-host-only', '-std=c++17 -Xclang -fsycl-is-host -isystem %s -isystem %s -isystem %s' % (config.sycl_include, config.opencl_include_dir, config.sycl_include + '/sycl/') ) ) llvm_config.add_tool_substitutions(['llvm-spirv'], [config.sycl_tools_dir]) diff --git a/sycl/test/separate-compile/test.cpp b/sycl/test/separate-compile/test.cpp index 30e58f50aee9b..df97ae177d5d1 100644 --- a/sycl/test/separate-compile/test.cpp +++ b/sycl/test/separate-compile/test.cpp @@ -7,13 +7,13 @@ // >> host compilation... // Driver automatically adds -D_DLL and -D_MT on Windows with -fsycl. // Add those defines required for Windows and harmless for Linux. -// RUN: %clangxx -D_DLL -D_MT -std=c++17 -include sycl_ihdr_a.h -g -c %s -o a.o -I %sycl_include -Wno-sycl-strict +// RUN: %clangxx -D_DLL -D_MT -std=c++17 -include sycl_ihdr_a.h -g -c %s -o a.o -I %sycl_include/sycl -Wno-sycl-strict // // >> ---- compile src2 // >> device compilation... // RUN: %clangxx -DB_CPP=1 -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -c -o b_kernel.bc -Wno-sycl-strict // >> host compilation... -// RUN: %clangxx -DB_CPP=1 -D_DLL -D_MT -std=c++17 -include sycl_ihdr_b.h -g -c %s -o b.o -I %sycl_include -Wno-sycl-strict +// RUN: %clangxx -DB_CPP=1 -D_DLL -D_MT -std=c++17 -include sycl_ihdr_b.h -g -c %s -o b.o -I %sycl_include/sycl -Wno-sycl-strict // // >> ---- bundle .o with .spv // >> run bundler diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 023b4b9d9f905..2c68781642059 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -1,5 +1,7 @@ // RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out // RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out +// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2017 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out +// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=1.2.1 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out #include From 0da8cdcd05fe00d053375e0860c510416407f1ee Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Wed, 23 Jun 2021 10:05:48 +0300 Subject: [PATCH 3/5] Apply comments --- sycl/test/esimd/enums.cpp | 21 +++++++++++---------- sycl/test/esimd/simd_copy_to_copy_from.cpp | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sycl/test/esimd/enums.cpp b/sycl/test/esimd/enums.cpp index d0a5b57dcfd8e..d9376efaf6ce5 100644 --- a/sycl/test/esimd/enums.cpp +++ b/sycl/test/esimd/enums.cpp @@ -8,32 +8,33 @@ using namespace sycl::ext::intel::experimental::esimd; void foo() SYCL_ESIMD_FUNCTION { - // These should produce deprecation messages for both device: + // These should produce deprecation messages for both host and device + // compilations: int x; - // CHECK: enums.cpp:15{{.*}}warning: 'WAIT' is deprecated + // CHECK: enums.cpp:16{{.*}}warning: 'WAIT' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(ESIMD_SBARRIER_WAIT); - // CHECK: enums.cpp:18{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: enums.cpp:19{{.*}}warning: 'ATOMIC_ADD' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(EsimdAtomicOpType::ATOMIC_ADD); - // CHECK: enums.cpp:21{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated + // CHECK: enums.cpp:22{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(ChannelMaskType::ESIMD_R_ENABLE); - // CHECK: enums.cpp:24{{.*}}warning: 'GENX_NOSAT' is deprecated + // CHECK: enums.cpp:25{{.*}}warning: 'GENX_NOSAT' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: x = static_cast(GENX_NOSAT); // A "border" between host and device compilations // CHECK-LABEL: 4 warnings generated - // And for host: - // CHECK: enums.cpp:15{{.*}}warning: 'WAIT' is deprecated + // For host: + // CHECK: enums.cpp:16{{.*}}warning: 'WAIT' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: - // CHECK: enums.cpp:18{{.*}}warning: 'ATOMIC_ADD' is deprecated + // CHECK: enums.cpp:19{{.*}}warning: 'ATOMIC_ADD' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: - // CHECK: enums.cpp:21{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated + // CHECK: enums.cpp:22{{.*}}warning: 'ESIMD_R_ENABLE' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: - // CHECK: enums.cpp:24{{.*}}warning: 'GENX_NOSAT' is deprecated + // CHECK: enums.cpp:25{{.*}}warning: 'GENX_NOSAT' is deprecated // CHECK: sycl/ext/intel/experimental/esimd/common.hpp{{.*}}note: // These should compile cleanly: diff --git a/sycl/test/esimd/simd_copy_to_copy_from.cpp b/sycl/test/esimd/simd_copy_to_copy_from.cpp index 13f4e05c5c794..981d63104f669 100644 --- a/sycl/test/esimd/simd_copy_to_copy_from.cpp +++ b/sycl/test/esimd/simd_copy_to_copy_from.cpp @@ -1,7 +1,7 @@ // RUN: not %clangxx -fsycl -fsycl-device-only -fsyntax-only %s 2>&1 | FileCheck %s // RUN: not %clangxx %fsycl-host-only -fsyntax-only %s 2>&1 | FileCheck %s -// This test checks that device and host compilers can: +// This test checks that both host and device compilers can: // - successfully compile simd::copy_to and simd::copy_from APIs // - emit an error if argument of an incompatible type is used // in place of the accessor argument From 18158a4b7fad405b9becd950bd04dcc704bcebea Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Thu, 24 Jun 2021 16:49:30 +0300 Subject: [PATCH 4/5] temp --- sycl/test/esimd/enums.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test/esimd/enums.cpp b/sycl/test/esimd/enums.cpp index d9376efaf6ce5..1129032ee4ceb 100644 --- a/sycl/test/esimd/enums.cpp +++ b/sycl/test/esimd/enums.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks compilation of various ESIMD enum types. Those which are // deprecated must produce deprecation messages. From 35b6ef9400b308208832e53fc9168167b7f8297b Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Thu, 24 Jun 2021 19:15:01 +0300 Subject: [PATCH 5/5] Ensure that no unexpected diagnostics emitted with FileCheck --- sycl/test/esimd/flat_atomic.cpp | 2 +- sycl/test/esimd/gather4_scatter4.cpp | 2 +- sycl/test/esimd/simd_copy_to_copy_from.cpp | 4 ++-- sycl/test/esimd/simd_subscript.cpp | 4 ++-- sycl/test/esimd/slm_atomic.cpp | 2 +- sycl/test/esimd/slm_load4.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sycl/test/esimd/flat_atomic.cpp b/sycl/test/esimd/flat_atomic.cpp index 5a749789b5e9d..98516593907d8 100644 --- a/sycl/test/esimd/flat_atomic.cpp +++ b/sycl/test/esimd/flat_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks compilation of ESIMD atomic APIs. Those which are deprecated // must produce deprecation messages. diff --git a/sycl/test/esimd/gather4_scatter4.cpp b/sycl/test/esimd/gather4_scatter4.cpp index 5328a6faed74a..318e189fec5a0 100644 --- a/sycl/test/esimd/gather4_scatter4.cpp +++ b/sycl/test/esimd/gather4_scatter4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks compilation of ESIMD slm gather4/scatter4 APIs. Those which // are deprecated must produce deprecation messages. diff --git a/sycl/test/esimd/simd_copy_to_copy_from.cpp b/sycl/test/esimd/simd_copy_to_copy_from.cpp index 981d63104f669..75ac76c7887fc 100644 --- a/sycl/test/esimd/simd_copy_to_copy_from.cpp +++ b/sycl/test/esimd/simd_copy_to_copy_from.cpp @@ -1,5 +1,5 @@ -// RUN: not %clangxx -fsycl -fsycl-device-only -fsyntax-only %s 2>&1 | FileCheck %s -// RUN: not %clangxx %fsycl-host-only -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: not %clangxx -fsycl -fsycl-device-only -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" +// RUN: not %clangxx %fsycl-host-only -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks that both host and device compilers can: // - successfully compile simd::copy_to and simd::copy_from APIs diff --git a/sycl/test/esimd/simd_subscript.cpp b/sycl/test/esimd/simd_subscript.cpp index 6f5139388235f..777db9ee9ddbd 100644 --- a/sycl/test/esimd/simd_subscript.cpp +++ b/sycl/test/esimd/simd_subscript.cpp @@ -1,4 +1,4 @@ -// RUN: not %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: not %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" #include @@ -69,7 +69,7 @@ void test_simd_const_subscript() SYCL_ESIMD_FUNCTION { const simd cv = 1; int val2 = cv[0]; // returns int instead of simd_view // CHECK: simd_subscript.cpp:72{{.*}}error: expression is not assignable - cv[1] = 0; // expected-error {{expression is not assignable}} + cv[1] = 0; } void test_simd_view_assign_op() SYCL_ESIMD_FUNCTION { diff --git a/sycl/test/esimd/slm_atomic.cpp b/sycl/test/esimd/slm_atomic.cpp index b8a0238e57633..58a229e54a39c 100644 --- a/sycl/test/esimd/slm_atomic.cpp +++ b/sycl/test/esimd/slm_atomic.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks compilation of ESIMD slm atomic APIs. Those which are // deprecated must produce deprecation messages. diff --git a/sycl/test/esimd/slm_load4.cpp b/sycl/test/esimd/slm_load4.cpp index 4684dff34be10..25a6bb777fcd1 100644 --- a/sycl/test/esimd/slm_load4.cpp +++ b/sycl/test/esimd/slm_load4.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clangxx -fsycl -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:" // This test checks compilation of ESIMD slm load4/store4 APIs. Those which are // deprecated must produce deprecation messages.