teak-llvm/clang/test/Sema/renderscript.rs
Pirama Arumuga Nainar e5d2d71a60 Revise RenderScript attribute declaration
Summary:
Address post-patch comments to r272342.

- Rename the 'kernel' attribute's name
- Idiomatically restrict the attribute to the 'RenderScript' LangOpt.

Reviewers: aaron.ballman, rsmith

Subscribers: cfe-commits, srhines

Differential Revision: http://reviews.llvm.org/D21240

llvm-svn: 272438
2016-06-10 21:51:18 +00:00

25 lines
741 B
Rust

// RUN: %clang_cc1 -fsyntax-only -verify -x renderscript -D__RENDERSCRIPT__ %s
// RUN: %clang_cc1 -fsyntax-only -verify -x c %s
#ifndef __RENDERSCRIPT__
// expected-warning@+2 {{'kernel' attribute ignored}}
#endif
void __attribute__((kernel)) kernel() {}
#ifndef __RENDERSCRIPT__
// expected-warning@+4 {{'kernel' attribute ignored}}
#else
// expected-warning@+2 {{'kernel' attribute only applies to functions}}
#endif
int __attribute__((kernel)) global;
#ifndef __RENDERSCRIPT__
// expected-error@+2 {{function return value cannot have __fp16 type; did you forget * ?}}
#endif
__fp16 fp16_return();
#ifndef __RENDERSCRIPT__
// expected-error@+2 {{parameters cannot have __fp16 type; did you forget * ?}}
#endif
void fp16_arg(__fp16 p);