Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / fp16-sema.c
blobf5406c519159d2f23d5af0d6c99296a5ae53f931
1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-linux-gnu -Wno-strict-prototypes -verify %s
2 // // REQUIRES: x86-registered-target
4 // Functions cannot have parameters of type __fp16.
5 extern void f (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
6 extern void g (__fp16 *);
8 extern void (*pf) (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
9 extern void (*pg) (__fp16*);
11 typedef void(*tf) (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
12 typedef void(*tg) (__fp16*);
14 void kf(a)
15 __fp16 a; { // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
18 void kg(a)
19 __fp16 *a; {
22 // Functions cannot return type __fp16.
23 extern __fp16 f1 (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
24 extern __fp16 *g1 (void);
26 extern __fp16 (*pf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
27 extern __fp16 *(*gf1) (void);
29 typedef __fp16 (*tf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
30 typedef __fp16 *(*tg1) (void);
32 void testComplex() {
33 // FIXME: Should these be valid?
34 _Complex __fp16 a; // expected-error {{'_Complex half' is invalid}}
35 __fp16 b;
36 a = __builtin_complex(b, b); // expected-error {{'_Complex half' is invalid}}