diff options
| author | Joey Gouly <joey.gouly@arm.com> | 2013-12-13 16:15:28 +0000 |
|---|---|---|
| committer | Joey Gouly <joey.gouly@arm.com> | 2013-12-13 16:15:28 +0000 |
| commit | 2cd9db1cefbbaea422f195a76ad74474b410ce3c (patch) | |
| tree | 3e7b1c5aa4b6d4f4cda285e32330bd8b02204ec5 /clang/test/SemaOpenCL/invalid-kernel-attrs.cl | |
| parent | 984c9d86cbc957b232e436e873fc47fcde5b57cc (diff) | |
| download | bcm5719-llvm-2cd9db1cefbbaea422f195a76ad74474b410ce3c.tar.gz bcm5719-llvm-2cd9db1cefbbaea422f195a76ad74474b410ce3c.zip | |
[OpenCL] Produce an error when the work group and vec type hint attributes
are used on non-kernel functions.
Reviewed by Aaron over IRC!
llvm-svn: 197243
Diffstat (limited to 'clang/test/SemaOpenCL/invalid-kernel-attrs.cl')
| -rw-r--r-- | clang/test/SemaOpenCL/invalid-kernel-attrs.cl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/invalid-kernel-attrs.cl b/clang/test/SemaOpenCL/invalid-kernel-attrs.cl index 668dc2a54d0..0da7ddf34dd 100644 --- a/clang/test/SemaOpenCL/invalid-kernel-attrs.cl +++ b/clang/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}} |

