From: Sven van Haastregt Date: Thu, 26 Sep 2019 13:31:36 +0000 (+0000) Subject: [OpenCL] Add -Wconversion to fdeclare-opencl-builtins test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47eb223dca7a1b3eb1b7d238699e8d7bcc9dff1a;p=clang [OpenCL] Add -Wconversion to fdeclare-opencl-builtins test Add the -Wconversion -Werror options to check no unexpected conversion is done. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D67714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372975 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaOpenCL/fdeclare-opencl-builtins.cl b/test/SemaOpenCL/fdeclare-opencl-builtins.cl index d8d3793841..250a3f008c 100644 --- a/test/SemaOpenCL/fdeclare-opencl-builtins.cl +++ b/test/SemaOpenCL/fdeclare-opencl-builtins.cl @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -DNO_HEADER -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -finclude-default-header -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -DNO_HEADER -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -finclude-default-header -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -DNO_HEADER -// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -DNO_HEADER +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -finclude-default-header +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -DNO_HEADER +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -finclude-default-header +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -DNO_HEADER +// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header #if __OPENCL_C_VERSION__ >= CL_VERSION_2_0 // expected-no-diagnostics @@ -99,6 +99,7 @@ kernel void basic_subgroup(global uint *out) { out[0] = get_sub_group_size(); #if __OPENCL_C_VERSION__ < CL_VERSION_2_0 // expected-error@-2{{implicit declaration of function 'get_sub_group_size' is invalid in OpenCL}} +// expected-error@-3{{implicit conversion changes signedness: 'int' to 'uint' (aka 'unsigned int')}} #endif }