Joey Gouly | 4bd55d9 | 2013-03-11 12:38:45 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify %s |
| 2 | |
Aaron Ballman | b724338 | 2013-07-23 19:30:11 +0000 | [diff] [blame] | 3 | kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{'vec_type_hint' attribute takes one argument}} |
Joey Gouly | 4bd55d9 | 2013-03-11 12:38:45 +0000 | [diff] [blame] | 4 | |
| 5 | kernel __attribute__((vec_type_hint(not_type))) void kernel2() {} //expected-error{{unknown type name 'not_type'}} |
| 6 | |
| 7 | kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{invalid attribute argument 'void' - expecting a vector or vectorizable scalar type}} |
| 8 | |
| 9 | kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{invalid attribute argument 'bool' - expecting a vector or vectorizable scalar type}} |
| 10 | |
| 11 | kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}} |
| 12 | |
Aaron Ballman | b724338 | 2013-07-23 19:30:11 +0000 | [diff] [blame] | 13 | kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}} |
Joey Gouly | 4bd55d9 | 2013-03-11 12:38:45 +0000 | [diff] [blame] | 14 | |
| 15 | 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}} |
| 16 | |
Joey Gouly | 2cd9db1 | 2013-12-13 16:15:28 +0000 | [diff] [blame] | 17 | __attribute__((reqd_work_group_size(8,16,32))) void kernel8(){} // expected-error {{attribute 'reqd_work_group_size' can only be applied to a kernel}} |
| 18 | |
| 19 | __attribute__((work_group_size_hint(8,16,32))) void kernel9(){} // expected-error {{attribute 'work_group_size_hint' can only be applied to a kernel}} |
| 20 | |
| 21 | __attribute__((vec_type_hint(char))) void kernel10(){} // expected-error {{attribute 'vec_type_hint' can only be applied to a kernel}} |
| 22 | |
Joey Gouly | 96b94e6 | 2014-01-03 14:16:55 +0000 | [diff] [blame^] | 23 | constant int foo1 __attribute__((reqd_work_group_size(8,16,32))) = 0; // expected-error {{'reqd_work_group_size' attribute only applies to functions}} |
Joey Gouly | 2cd9db1 | 2013-12-13 16:15:28 +0000 | [diff] [blame] | 24 | |
Joey Gouly | 96b94e6 | 2014-01-03 14:16:55 +0000 | [diff] [blame^] | 25 | constant int foo2 __attribute__((work_group_size_hint(8,16,32))) = 0; // expected-error {{'work_group_size_hint' attribute only applies to functions}} |
Joey Gouly | 2cd9db1 | 2013-12-13 16:15:28 +0000 | [diff] [blame] | 26 | |
Joey Gouly | 96b94e6 | 2014-01-03 14:16:55 +0000 | [diff] [blame^] | 27 | constant int foo3 __attribute__((vec_type_hint(char))) = 0; // expected-error {{'vec_type_hint' attribute only applies to functions}} |
Joey Gouly | d499303 | 2014-01-02 12:04:42 +0000 | [diff] [blame] | 28 | |
| 29 | void f_kernel_image2d_t( kernel image2d_t image ) { // expected-error {{'kernel' attribute only applies to functions}} |
| 30 | int __kernel x; // expected-error {{'__kernel' attribute only applies to functions}} |
| 31 | |
| 32 | } |