1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
15 #include "test_macros.h"
17 template <class T
, bool expected
>
21 static_assert(std::numeric_limits
<T
>::is_signed
== expected
, "is_signed test 1");
22 static_assert(std::numeric_limits
<const T
>::is_signed
== expected
, "is_signed test 2");
23 static_assert(std::numeric_limits
<volatile T
>::is_signed
== expected
, "is_signed test 3");
24 static_assert(std::numeric_limits
<const volatile T
>::is_signed
== expected
, "is_signed test 4");
30 test
<char, char(-1) < char(0)>();
31 test
<signed char, true>();
32 test
<unsigned char, false>();
33 test
<wchar_t, wchar_t(-1) < wchar_t(0)>();
34 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
35 test
<char8_t
, false>();
37 test
<char16_t
, false>();
38 test
<char32_t
, false>();
40 test
<unsigned short, false>();
42 test
<unsigned int, false>();
44 test
<unsigned long, false>();
45 test
<long long, true>();
46 test
<unsigned long long, false>();
47 #ifndef TEST_HAS_NO_INT128
48 test
<__int128_t
, true>();
49 test
<__uint128_t
, false>();
53 test
<long double, true>();