xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/fp16-sema.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // Functions cannot have parameters of type __fp16.
4*f4a2713aSLionel Sambuc extern void f (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
5*f4a2713aSLionel Sambuc extern void g (__fp16 *);
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc extern void (*pf) (__fp16);  // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
8*f4a2713aSLionel Sambuc extern void (*pg) (__fp16*);
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc typedef void(*tf) (__fp16);  // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
11*f4a2713aSLionel Sambuc typedef void(*tg) (__fp16*);
12*f4a2713aSLionel Sambuc 
kf(a)13*f4a2713aSLionel Sambuc void kf(a)
14*f4a2713aSLionel Sambuc  __fp16 a; {  // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
kg(a)17*f4a2713aSLionel Sambuc void kg(a)
18*f4a2713aSLionel Sambuc  __fp16 *a; {
19*f4a2713aSLionel Sambuc }
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc // Functions cannot return type __fp16.
22*f4a2713aSLionel Sambuc extern __fp16 f1 (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
23*f4a2713aSLionel Sambuc extern __fp16 *g1 (void);
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc extern __fp16 (*pf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
26*f4a2713aSLionel Sambuc extern __fp16 *(*gf1) (void);
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc typedef __fp16 (*tf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
29*f4a2713aSLionel Sambuc typedef __fp16 *(*tg1) (void);
30*f4a2713aSLionel Sambuc 
31