forked from OSchip/llvm-project
long double should be 64 bits on FreeBSD/MIPS64. It possibly should be on
Linux too, as I think we inherited it from there. The ABI spec says 128-bit, although I think SGI's compiler on IRIX may be the only thing ever to support this. llvm-svn: 169674
This commit is contained in:
parent
6b02d46dae
commit
a87d85994b
|
@ -4222,6 +4222,10 @@ public:
|
|||
PointerWidth = PointerAlign = 64;
|
||||
LongDoubleWidth = LongDoubleAlign = 128;
|
||||
LongDoubleFormat = &llvm::APFloat::IEEEquad;
|
||||
if (getTriple().getOS() == llvm::Triple::FreeBSD) {
|
||||
LongDoubleWidth = LongDoubleAlign = 64;
|
||||
LongDoubleFormat = &llvm::APFloat::IEEEdouble;
|
||||
}
|
||||
SuitableAlign = 128;
|
||||
}
|
||||
virtual bool setABI(const std::string &Name) {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// RUN: %clang_cc1 -triple mips64-unknown-freebsd -std=c11 -verify %s
|
||||
// RUN: %clang_cc1 -triple mips-unknown-freebsd -std=c11 -verify %s
|
||||
// RUN: %clang_cc1 -triple mips-unknown-linux-std=c11 -verify %s
|
||||
// RUN: %clang_cc1 -triple mips64-unknown-linux-std=c11 -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
#ifdef _ABI64
|
||||
# ifdef __FreeBSD__
|
||||
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
|
||||
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
|
||||
# else
|
||||
_Static_assert(sizeof(long double) == 16, "sizeof long double is wrong");
|
||||
_Static_assert(_Alignof(long double) == 16, "alignof long double is wrong");
|
||||
# endif
|
||||
#else
|
||||
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
|
||||
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue