Skip to content

Commit 7ec6188

Browse files
committed
[OpenCL] Add some more kernel argument tests
Differential Revision: https://reviews.llvm.org/D92406
1 parent fe21c86 commit 7ec6188

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/test/SemaOpenCL/invalid-kernel-parameters.cl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ __kernel void no_privatearray(__private int i[]) { }
2323
// expected-error@+1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
2424
__kernel void no_addrsp_ptr(int *ptr) { }
2525

26+
// expected-error@+1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
27+
__kernel void no_defaultarray(int i[]) { }
28+
2629
#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
30+
kernel void no_genericptr(generic int *ptr) { }
31+
// expected-error@-1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
2732
kernel void no_ptr_private_ptr(private int * global *i) { }
2833
// expected-error@-1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
2934
kernel void no_ptr_ptr_private_ptr(private int * global * global *i) { }
@@ -32,6 +37,8 @@ kernel void no_ptr_private_ptr_ptr(global int * private * global *i) { }
3237
// expected-error@-1{{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}}
3338
#endif
3439

40+
void no_addrspace_param(global int x) { } // expected-error{{parameter may not be qualified with an address space}}
41+
3542
// Disallowed: parameters with type
3643
// bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t
3744
// or a struct / union with any of these types in them

0 commit comments

Comments
 (0)