A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the second batch of tests being updated (there are a significant number of other tests left to be updated).
25 lines
749 B
Rust
25 lines
749 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(void) {}
|
|
|
|
#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(void);
|
|
|
|
#ifndef __RENDERSCRIPT__
|
|
// expected-error@+2 {{parameters cannot have __fp16 type; did you forget * ?}}
|
|
#endif
|
|
void fp16_arg(__fp16 p);
|