From 67b9ed1e9a93d7fb5fc3c077b51ef28318596101 Mon Sep 17 00:00:00 2001 From: Elizabeth Andrews Date: Mon, 5 Oct 2020 12:19:20 -0700 Subject: [PATCH 1/2] [SYCL] Fix test failure due to size discrepancy of pointers in 32 and 64 bit environment. Fix uses regex to specify size in diagnostic. Signed-off-by: Elizabeth Andrews --- clang/test/SemaSYCL/args-size-overflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/SemaSYCL/args-size-overflow.cpp b/clang/test/SemaSYCL/args-size-overflow.cpp index fb3bcace406ad..fc0f33054e293 100644 --- a/clang/test/SemaSYCL/args-size-overflow.cpp +++ b/clang/test/SemaSYCL/args-size-overflow.cpp @@ -10,7 +10,7 @@ queue q; using Accessor = accessor; -// expected-warning@Inputs/sycl.hpp:220 {{size of kernel arguments (7994 bytes) may exceed the supported maximum of 2048 bytes on some devices}} +// expected-warning-re@Inputs/sycl.hpp:220 {{size of kernel arguments ({{.*}} bytes) may exceed the supported maximum of 2048 bytes on some devices}} void use() { struct S { @@ -25,4 +25,4 @@ void use() { // expected-note@+1 {{in instantiation of function template specialization}} h.single_task(L); }); -} \ No newline at end of file +} From 2aa047dc94feafb9627cb249616ea3111e0db52a Mon Sep 17 00:00:00 2001 From: Elizabeth Andrews Date: Tue, 6 Oct 2020 09:07:37 -0700 Subject: [PATCH 2/2] Apply review comment - separate runs for 32 and 64 bit environment. Size is hardcoded in diagnostic Signed-off-by: Elizabeth Andrews --- clang/test/SemaSYCL/args-size-overflow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clang/test/SemaSYCL/args-size-overflow.cpp b/clang/test/SemaSYCL/args-size-overflow.cpp index fc0f33054e293..3b442f583b415 100644 --- a/clang/test/SemaSYCL/args-size-overflow.cpp +++ b/clang/test/SemaSYCL/args-size-overflow.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsycl -fsycl-is-device -internal-isystem %S/Inputs -fsyntax-only -Wsycl-strict -sycl-std=2020 -verify %s +// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64 -internal-isystem %S/Inputs -fsyntax-only -Wsycl-strict -sycl-std=2020 -verify %s -DSPIR64 +// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir -internal-isystem %S/Inputs -fsyntax-only -Wsycl-strict -sycl-std=2020 -verify %s -DSPIR32 #include "sycl.hpp" class Foo; @@ -9,8 +10,11 @@ queue q; using Accessor = accessor; - -// expected-warning-re@Inputs/sycl.hpp:220 {{size of kernel arguments ({{.*}} bytes) may exceed the supported maximum of 2048 bytes on some devices}} +#ifdef SPIR64 +// expected-warning@Inputs/sycl.hpp:220 {{size of kernel arguments (7994 bytes) may exceed the supported maximum of 2048 bytes on some devices}} +#elif SPIR32 +// expected-warning@Inputs/sycl.hpp:220 {{size of kernel arguments (7986 bytes) may exceed the supported maximum of 2048 bytes on some devices}} +#endif void use() { struct S {