xref: /llvm-project/clang/test/Sema/Float16.c (revision 570995eba2f93d639e69b6b12817d44a3b26cc72)
1 // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-pc %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-pc -target-feature +sse2 %s -DHAVE
3 // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s -DHAVE
4 // RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
5 // RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
6 // RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
7 // RUN: %clang_cc1 -fsyntax-only -verify -triple riscv32 %s -DHAVE
8 // RUN: %clang_cc1 -fsyntax-only -verify -triple riscv64 %s -DHAVE
9 
10 #ifndef HAVE
11 // expected-error@+2{{_Float16 is not supported on this target}}
12 #endif // HAVE
13 _Float16 f;
14 
15 #ifdef HAVE
16 _Complex _Float16 a;
builtin_complex(void)17 void builtin_complex(void) {
18   _Float16 a = 0;
19   (void)__builtin_complex(a, a); // expected-error {{'_Complex _Float16' is invalid}}
20 }
21 #endif
22