Pirama Arumuga Nainar | 8b788d0 | 2016-06-09 23:34:20 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -x renderscript -D__RENDERSCRIPT__ %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -verify -x c %s |
| 3 | |
| 4 | #ifndef __RENDERSCRIPT__ |
Pirama Arumuga Nainar | e5d2d71 | 2016-06-10 21:51:18 +0000 | [diff] [blame] | 5 | // expected-warning@+2 {{'kernel' attribute ignored}} |
Pirama Arumuga Nainar | 8b788d0 | 2016-06-09 23:34:20 +0000 | [diff] [blame] | 6 | #endif |
Pirama Arumuga Nainar | e5d2d71 | 2016-06-10 21:51:18 +0000 | [diff] [blame] | 7 | void __attribute__((kernel)) kernel() {} |
Pirama Arumuga Nainar | 8b788d0 | 2016-06-09 23:34:20 +0000 | [diff] [blame] | 8 | |
Pirama Arumuga Nainar | e5d2d71 | 2016-06-10 21:51:18 +0000 | [diff] [blame] | 9 | #ifndef __RENDERSCRIPT__ |
| 10 | // expected-warning@+4 {{'kernel' attribute ignored}} |
| 11 | #else |
| 12 | // expected-warning@+2 {{'kernel' attribute only applies to functions}} |
| 13 | #endif |
Pirama Arumuga Nainar | 8b788d0 | 2016-06-09 23:34:20 +0000 | [diff] [blame] | 14 | int __attribute__((kernel)) global; |
| 15 | |
| 16 | #ifndef __RENDERSCRIPT__ |
| 17 | // expected-error@+2 {{function return value cannot have __fp16 type; did you forget * ?}} |
| 18 | #endif |
| 19 | __fp16 fp16_return(); |
| 20 | |
| 21 | #ifndef __RENDERSCRIPT__ |
| 22 | // expected-error@+2 {{parameters cannot have __fp16 type; did you forget * ?}} |
| 23 | #endif |
| 24 | void fp16_arg(__fp16 p); |