Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / riscv-fp16.c
blob7c39f9f9e7fbc90747e274c24a5e757d2e3dfa3e
1 // RUN: %clang_cc1 -fsyntax-only -triple riscv32 -Wno-strict-prototypes -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -triple riscv64 -Wno-strict-prototypes -verify %s
3 // REQUIRES: riscv-registered-target
5 // Functions cannot have parameters of type __fp16.
6 extern void f (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
7 extern void g (__fp16 *);
9 extern void (*pf) (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
10 extern void (*pg) (__fp16*);
12 typedef void(*tf) (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
13 typedef void(*tg) (__fp16*);
15 void kf(a)
16 __fp16 a; { // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
19 void kg(a)
20 __fp16 *a; {
23 // Functions cannot return type __fp16.
24 extern __fp16 f1 (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
25 extern __fp16 *g1 (void);
27 extern __fp16 (*pf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
28 extern __fp16 *(*gf1) (void);
30 typedef __fp16 (*tf1) (void); // expected-error {{function return value cannot have __fp16 type; did you forget * ?}}
31 typedef __fp16 *(*tg1) (void);
33 void testComplex() {
34 // FIXME: Should these be valid?
35 _Complex __fp16 a; // expected-error {{'_Complex half' is invalid}}
36 __fp16 b;
37 a = __builtin_complex(b, b); // expected-error {{'_Complex half' is invalid}}