summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@gmail.com>2014-01-02 12:04:42 +0000
committerJoey Gouly <joey.gouly@gmail.com>2014-01-02 12:04:42 +0000
commitbaf47f1244dc27cf69b761260b38cb3552c41bfd (patch)
treebe77369ddbd6b9f7b80255d3a7b8363c03e3c503 /test/SemaOpenCL
parentc8a1cf95f87d91fa7e4e7e7953b0380b1611b540 (diff)
[OpenCL] The kernel attribute can only be used on functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/invalid-kernel-attrs.cl5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-kernel-attrs.cl b/test/SemaOpenCL/invalid-kernel-attrs.cl
index 0da7ddf34d..81ce1227cb 100644
--- a/test/SemaOpenCL/invalid-kernel-attrs.cl
+++ b/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -25,3 +25,8 @@ constant int foo1 __attribute__((reqd_work_group_size(8,16,32))); // expected-e
constant int foo2 __attribute__((work_group_size_hint(8,16,32))); // expected-error {{'work_group_size_hint' attribute only applies to functions}}
constant int foo3 __attribute__((vec_type_hint(char))); // expected-error {{'vec_type_hint' attribute only applies to functions}}
+
+void f_kernel_image2d_t( kernel image2d_t image ) { // expected-error {{'kernel' attribute only applies to functions}}
+ int __kernel x; // expected-error {{'__kernel' attribute only applies to functions}}
+
+}