[PATCH] D92406: [OpenCL] Add some more kernel argument tests
Sven van Haastregt via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 1 10:18:58 PST 2020
svenvh created this revision.
svenvh added a reviewer: Anastasia.
Herald added a subscriber: yaxunl.
Herald added a project: clang.
svenvh requested review of this revision.
These cases weren't in any of the SemaOpenCL tests yet.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92406
Files:
clang/test/SemaOpenCL/invalid-kernel-parameters.cl
Index: clang/test/SemaOpenCL/invalid-kernel-parameters.cl
===================================================================
--- clang/test/SemaOpenCL/invalid-kernel-parameters.cl
+++ clang/test/SemaOpenCL/invalid-kernel-parameters.cl
@@ -23,7 +23,12 @@
// expected-error at +1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
__kernel void no_addrsp_ptr(int *ptr) { }
+// expected-error at +1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
+__kernel void no_defaultarray(int i[]) { }
+
#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+kernel void no_genericptr(generic int *ptr) { }
+// expected-error at -1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
kernel void no_ptr_private_ptr(private int * global *i) { }
// expected-error at -1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
kernel void no_ptr_ptr_private_ptr(private int * global * global *i) { }
@@ -32,6 +37,8 @@
// expected-error at -1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
#endif
+void no_addrspace_param(global int x) { } // expected-error{{parameter may not be qualified with an address space}}
+
// Disallowed: parameters with type
// bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t
// or a struct / union with any of these types in them
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92406.308700.patch
Type: text/x-patch
Size: 1523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201201/5233c10a/attachment-0001.bin>
More information about the cfe-commits
mailing list