llvm-project/clang/test/SemaOpenCL
Anastasia Stulova 5b6dda33d1 [Sema][OpenCL] Make address space conversions a bit stricter.
The semantics for converting nested pointers between address
spaces are not very well defined. Some conversions which do not
really carry any meaning only produce warnings, and in some cases
warnings hide invalid conversions, such as 'global int*' to
'local float*'!

This patch changes the logic in checkPointerTypesForAssignment
and checkAddressSpaceCast to fail properly on implicit conversions
that should definitely not be permitted. We also dig deeper into the
pointer types and warn on explicit conversions where the address
space in a nested pointer changes, regardless of whether the address
space is compatible with the corresponding pointer nesting level
on the destination type.

Fixes PR39674!

Patch by ebevhan (Bevin Hansson)!

Differential Revision: https://reviews.llvm.org/D58236

llvm-svn: 360258
2019-05-08 14:23:49 +00:00
..
access-qualifier.cl [OpenCL] Relax diagnostics on OpenCL access qualifiers 2018-09-06 15:10:26 +00:00
address-spaces-conversions-cl2.0.cl [Sema] Change addr space diagnostics in casts to follow C++ style. 2019-03-07 17:06:30 +00:00
address-spaces.cl [Sema][OpenCL] Make address space conversions a bit stricter. 2019-05-08 14:23:49 +00:00
amdgpu-attrs.cl [AMDGPU] Allow using integral non-type template parameters 2019-02-26 18:49:36 +00:00
arithmetic-conversions.cl
array-init.cl
array-parameters.cl
as_type.cl
atomic-init.cl
atomic-ops.cl __c11_atomic_load's _Atomic can be const 2018-08-02 17:35:46 +00:00
block-array-capturing.cl Revert r326937 "[OpenCL] Remove block invoke function from emitted block literal struct" 2018-10-02 13:02:24 +00:00
bool-vectors.cl
builtin.cl [OpenCL] Improved testing of default header. 2019-03-19 13:04:17 +00:00
builtins-amdgcn-error-ci.cl AMDGPU: Add another missing builtin 2018-08-09 22:18:37 +00:00
builtins-amdgcn-error-f16.cl
builtins-amdgcn-error-gfx9.cl
builtins-amdgcn-error-vi.cl [AMDGPU] rename vi-insts into gfx8-insts 2019-04-05 18:25:00 +00:00
builtins-amdgcn-error.cl AMDGPU: add __builtin_amdgcn_update_dpp 2018-10-17 02:32:26 +00:00
cl20-device-side-enqueue.cl [OpenCL] Remove unwanted signedness conversion from tests 2018-10-19 09:01:37 +00:00
clang-builtin-version.cl Revert "We allow implicit function declarations as an extension in all C dialects. Remove OpenCL special case." 2018-09-24 14:21:56 +00:00
clk_event_t.cl Allow clk_event_t comparisons 2018-11-01 12:43:00 +00:00
cond.cl
convergent.cl
endian-attr.cl
event_t.cl
event_t_overload.cl [Sema][OpenCL] Make address space conversions a bit stricter. 2019-05-08 14:23:49 +00:00
ext_vectors.cl
extension-begin.cl [OpenCL] Fix diagnostic message about overload candidates 2018-11-07 13:07:18 +00:00
extension-begin.h [OpenCL] Fix serialization of OpenCLExtensionDecls 2018-10-29 11:14:01 +00:00
extension-version.cl [OpenCL][PR40603] In C++ preserve compatibility with OpenCL C v2.0 2019-02-07 17:32:37 +00:00
extensions.cl [OpenCL] Improved testing of default header. 2019-03-19 13:04:17 +00:00
format-strings-fixit.cl [OpenGL] Fix test on PPC after r352540 2019-01-30 11:24:04 +00:00
func.cl [OpenCL] Allow function declaration with empty argument list. 2017-10-11 11:16:31 +00:00
half.cl
images.cl
init.cl
intel-subgroup-avc-ext-types.cl [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension 2018-11-08 11:25:41 +00:00
invalid-assignment-constant-address-space.cl
invalid-block.cl
invalid-constant.cl
invalid-image.cl [OpenCL][PR40707] Allow OpenCL C types in C++ mode. 2019-02-15 12:07:57 +00:00
invalid-kernel-attrs.cl Merge two attribute diagnostics into one 2018-09-17 10:39:46 +00:00
invalid-kernel-parameters.cl [OpenCL] Forbid size dependent types used as kernel arguments 2018-07-31 20:26:43 +00:00
invalid-kernel.cl
invalid-pipe-builtin-cl2.0.cl
invalid-pipes-cl2.0.cl [OpenCL] Allow function declaration with empty argument list. 2017-10-11 11:16:31 +00:00
lit.local.cfg
logical-ops.cl DR1687: When overload resolution selects a built-in operator, implicit 2018-06-27 20:30:34 +00:00
multistep-explicit-cast.cl [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166) 2018-07-24 08:16:50 +00:00
nosvm.cl
null_literal.cl
null_queue.cl [OpenCL] Allow zero assignment and comparisons between queue_t type variables 2018-09-25 12:59:34 +00:00
numbered-address-space.cl [Sema][OpenCL] Make address space conversions a bit stricter. 2019-05-08 14:23:49 +00:00
pipes-1.2-negative.cl
predefined-expr.cl [OpenCL] Add constant address space to __func__ in AST. 2018-05-09 13:23:26 +00:00
printf-format-string-warnings.cl OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
printf-format-strings.cl OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
queue_t_overload.cl [Sema][OpenCL] Make address space conversions a bit stricter. 2019-05-08 14:23:49 +00:00
sampler_t.cl [OpenCL] Add test for constant sampler argument 2018-08-14 13:56:52 +00:00
sampler_t_overload.cl
shifts.cl
sizeof.cl
storageclass-cl20.cl [OpenCL] Add LangAS::opencl_private to represent private address space in AST 2017-10-13 03:37:48 +00:00
storageclass.cl [OpenCL] Restrict various keywords in OpenCL C++ mode 2018-05-09 13:16:17 +00:00
str_literals.cl
to_addr_builtin.cl [OpenCL] Improve extension-version.cl and to_addr_builtin.cl tests 2018-09-27 13:20:29 +00:00
types.cl
unroll-hint.cl
unsupported.cl
vec_compare.cl
vec_step.cl
vector_conv_invalid.cl
vector_inc_dec_ops.cl
vector_literals_const.cl
vector_literals_invalid.cl
vector_swizzle_length.cl [OpenCL] Restrict swizzle length check to OpenCL mode 2017-10-17 17:54:57 +00:00
warn-missing-prototypes.cl