From 05d5cdb5b31fe04e10383061df0e761d5259c594 Mon Sep 17 00:00:00 2001 From: Mariya Podchishchaeva Date: Tue, 25 Aug 2020 17:50:22 +0300 Subject: [PATCH] Add diagnostic to SyclStrict group --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 +- clang/test/SemaSYCL/num-args-overflow.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 041d5c85dbfd6..26e74f6a4c2ea 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10992,7 +10992,7 @@ def err_sycl_restrict : Error< "}0">; def warn_sycl_kernel_too_many_args : Warning< "resulting number of kernel arguments %0 is greater than maximum supported " - "on GPU device - %1">; + "on GPU device - %1">, InGroup; def err_sycl_virtual_types : Error< "No class with a vtable can be used in a SYCL kernel or any code included in the kernel">; def note_sycl_recursive_function_declared_here: Note<"function implemented using recursion declared here">; diff --git a/clang/test/SemaSYCL/num-args-overflow.cpp b/clang/test/SemaSYCL/num-args-overflow.cpp index a23bf06b98baa..3d942bb1c09a4 100644 --- a/clang/test/SemaSYCL/num-args-overflow.cpp +++ b/clang/test/SemaSYCL/num-args-overflow.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -fsycl -triple spir64_gen -DGPU -fsycl-is-device -fsyntax-only -verify %s // RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsycl -triple spir64_gen -Wno-sycl-strict -fsycl-is-device -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsycl -triple spir64_gen -Werror=sycl-strict -DERROR -fsycl-is-device -fsyntax-only -verify %s template __attribute__((sycl_kernel)) void kernel(F kernelFunc) { @@ -9,7 +11,9 @@ __attribute__((sycl_kernel)) void kernel(F kernelFunc) { void use() { int Arr[2001]; #ifdef GPU - // expected-warning@+4 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}} + // expected-warning@+6 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}} +#elif ERROR + // expected-error@+4 {{resulting number of kernel arguments 2001 is greater than maximum supported on GPU device - 2000}} #else // expected-no-diagnostics #endif