summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-12-13 16:15:28 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-12-13 16:15:28 +0000
commit1366f26a78a293be5054f32001ce73a4db4a82f8 (patch)
treeff8aaca3aa325ebf79003f3eaab0615cdbfbc55b /test/SemaOpenCL
parent90c7cb42812845f0bd56b1a124c96de10316526d (diff)
[OpenCL] Produce an error when the work group and vec type hint attributes
are used on non-kernel functions. Reviewed by Aaron over IRC! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/invalid-kernel-attrs.cl11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-kernel-attrs.cl b/test/SemaOpenCL/invalid-kernel-attrs.cl
index 668dc2a54d..0da7ddf34d 100644
--- a/test/SemaOpenCL/invalid-kernel-attrs.cl
+++ b/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -14,3 +14,14 @@ kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expe
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different parameters}}
+__attribute__((reqd_work_group_size(8,16,32))) void kernel8(){} // expected-error {{attribute 'reqd_work_group_size' can only be applied to a kernel}}
+
+__attribute__((work_group_size_hint(8,16,32))) void kernel9(){} // expected-error {{attribute 'work_group_size_hint' can only be applied to a kernel}}
+
+__attribute__((vec_type_hint(char))) void kernel10(){} // expected-error {{attribute 'vec_type_hint' can only be applied to a kernel}}
+
+constant int foo1 __attribute__((reqd_work_group_size(8,16,32))); // expected-error {{'reqd_work_group_size' attribute only applies to functions}}
+
+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}}