]>
Commit | Line | Data |
---|---|---|
7b30f13b | 1 | // PR c++/108099 |
3907147a | 2 | // { dg-do compile { target { c++11 && int128 } } } |
7b30f13b JM |
3 | // { dg-options "" } |
4 | ||
5 | using u128 = unsigned __int128_t; | |
6 | using s128 = signed __int128_t; | |
7 | template <typename T, T v> struct integral_constant { | |
8 | static constexpr T value = v; | |
9 | }; | |
10 | typedef integral_constant <bool, false> false_type; | |
11 | typedef integral_constant <bool, true> true_type; | |
12 | template <class T, class U> | |
13 | struct is_same : false_type {}; | |
14 | template <class T> | |
15 | struct is_same <T, T> : true_type {}; | |
16 | static_assert (is_same <__int128, s128>::value, ""); | |
17 | static_assert (is_same <signed __int128, s128>::value, ""); | |
18 | static_assert (is_same <__int128_t, s128>::value, ""); | |
19 | static_assert (is_same <unsigned __int128, u128>::value, ""); // { dg-bogus "" "" { xfail *-*-* } } | |
20 | static_assert (is_same <__uint128_t, u128>::value, ""); // { dg-bogus "" "" { xfail *-*-* } } | |
21 | static_assert (sizeof (s128) == sizeof (__int128), ""); | |
22 | static_assert (sizeof (u128) == sizeof (unsigned __int128), ""); | |
23 | static_assert (s128(-1) < 0, ""); | |
24 | static_assert (u128(-1) > 0, ""); |