| 1 |
//===----------------------------------------------------------------------===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
// UNSUPPORTED: c++03, c++11, c++14, c++17 |
| 10 |
|
| 11 |
// The following platforms have sizeof(long double) == sizeof(double), so this test doesn't apply to them. |
| 12 |
// This test does apply to aarch64 where Arm's AAPCS64 is followed. There they are different sizes. |
| 13 |
// XFAIL: target={{arm64|arm64e|armv(7|8)(l|m)?|powerpc|powerpc64}}-{{.+}} |
| 14 |
|
| 15 |
// MSVC configurations have long double equal to regular double on all |
| 16 |
// architectures. |
| 17 |
// XFAIL: target={{.+}}-pc-windows-msvc |
| 18 |
|
| 19 |
// ARM/AArch64 MinGW also has got long double equal to regular double, just |
| 20 |
// like MSVC (thus match both MinGW and MSVC here, for those architectures). |
| 21 |
// XFAIL: target={{aarch64|armv7}}-{{.*}}-windows-{{.+}} |
| 22 |
|
| 23 |
// Android's 32-bit x86 target has long double equal to regular double. |
| 24 |
// XFAIL: target=i686-{{.+}}-android{{.*}} |
| 25 |
|
| 26 |
// <compare> |
| 27 |
|
| 28 |
// template<class T> constexpr strong_ordering strong_order(const T& a, const T& b); |
| 29 |
|
| 30 |
// libc++ does not support strong_order(long double, long double) quite yet. |
| 31 |
// This test verifies the error message we give for that case. |
| 32 |
// TODO: remove this test once long double is properly supported. |
| 33 |
|
| 34 |
#include <compare> |
| 35 |
|
| 36 |
#include "test_macros.h" |
| 37 |
|
| 38 |
void f() { |
| 39 |
long double ld = 3.14; |
| 40 |
(void)std::strong_order(ld, ld); // expected-error@*:* {{std::strong_order is unimplemented for this floating-point type}} |
| 41 |
} |