[llvm-branch-commits] [clang] 7ec6188 - [OpenCL] Add some more kernel argument tests
Sven van Haastregt via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 3 02:26:23 PST 2020
Author: Sven van Haastregt
Date: 2020-12-03T10:21:29Z
New Revision: 7ec61889214d98f09eec7f18d0db66dcfdc68323
URL: https://github.com/llvm/llvm-project/commit/7ec61889214d98f09eec7f18d0db66dcfdc68323
DIFF: https://github.com/llvm/llvm-project/commit/7ec61889214d98f09eec7f18d0db66dcfdc68323.diff
LOG: [OpenCL] Add some more kernel argument tests
Differential Revision: https://reviews.llvm.org/D92406
Added:
Modified:
clang/test/SemaOpenCL/invalid-kernel-parameters.cl
Removed:
################################################################################
diff --git a/clang/test/SemaOpenCL/invalid-kernel-parameters.cl b/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
index 9fce92dbd6c3..96e6f7886b73 100644
--- a/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
+++ b/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
@@ -23,7 +23,12 @@ __kernel void no_privatearray(__private int i[]) { }
// 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 @@ kernel void no_ptr_private_ptr_ptr(global int * private * global *i) { }
// 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, ptr
diff _t, intptr_t, and uintptr_t
// or a struct / union with any of these types in them
More information about the llvm-branch-commits
mailing list