blob: 80be5ae424f8ccbab244614a29649f57166d3208 [file] [log] [blame]
Pirama Arumuga Nainar8b788d02016-06-09 23:34:20 +00001// 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 Nainare5d2d712016-06-10 21:51:18 +00005// expected-warning@+2 {{'kernel' attribute ignored}}
Pirama Arumuga Nainar8b788d02016-06-09 23:34:20 +00006#endif
Pirama Arumuga Nainare5d2d712016-06-10 21:51:18 +00007void __attribute__((kernel)) kernel() {}
Pirama Arumuga Nainar8b788d02016-06-09 23:34:20 +00008
Pirama Arumuga Nainare5d2d712016-06-10 21:51:18 +00009#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 Nainar8b788d02016-06-09 23:34:20 +000014int __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
24void fp16_arg(__fp16 p);