Phoebe Wang abeeae570e [X86] Support _Float16 on SSE2 and up
This is split from D113107 to address #56204 and https://discourse.llvm.org/t/how-to-build-compiler-rt-for-new-x86-half-float-abi/63366

Reviewed By: zahiraam, rjmccall, bkramer, MaskRay

Differential Revision: https://reviews.llvm.org/D128571
2022-06-30 17:21:37 +08:00

21 lines
750 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-pc %s
// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-pc -target-feature +sse2 %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
#ifdef HAVE
// expected-no-diagnostics
#endif // HAVE
#ifndef HAVE
// expected-error@+2{{_Float16 is not supported on this target}}
#endif // !HAVE
_Float16 f;
#ifndef HAVE
// expected-error@+2{{invalid suffix 'F16' on floating constant}}
#endif // !HAVE
const auto g = 1.1F16;