summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-17 23:53:26 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-17 23:53:26 +0000
commita3ee70c2b70b4e1d423dcfab6b494536bb2e0e02 (patch)
treec3c3bbc697c8eb502283f26c846f130bab407130 /libstdc++-v3
parent010db245e57d351bb70b49660187f8a52dc18ef2 (diff)
downloadgcc-a3ee70c2b70b4e1d423dcfab6b494536bb2e0e02.tar.gz
2011-09-17 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50441 * acinclude.m4 ([GLIBCXX_ENABLE_INT128_FLOAT128]): Add. * configure.ac: Call it. * include/std/type_traits (__is_integral_helper<__int128_t>, __is_integral_helper<__uint128_t>, __is_floating_point_helper<__float128>, __make_unsigned<__int128_t>, __make_signed<__uint128_t>): Add. * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Extend. * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/is_signed/value.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise. * testsuite/20_util/is_integral/value.cc: Likewise. * testsuite/20_util/is_floating_point/value.cc: New. * testsuite/20_util/is_floating_point/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_floating_point/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error line numbers. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. * configure: Regenerate. * config.h.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178933 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog29
-rw-r--r--libstdc++-v3/acinclude.m476
-rw-r--r--libstdc++-v3/config.h.in6
-rwxr-xr-xlibstdc++-v3/configure90
-rw-r--r--libstdc++-v3/configure.ac1
-rw-r--r--libstdc++-v3/include/std/type_traits28
-rw-r--r--libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/is_floating_point/requirements/explicit_instantiation.cc29
-rw-r--r--libstdc++-v3/testsuite/20_util/is_floating_point/requirements/typedefs.cc35
-rw-r--r--libstdc++-v3/testsuite/20_util/is_floating_point/value.cc68
-rw-r--r--libstdc++-v3/testsuite/20_util/is_integral/value.cc12
-rw-r--r--libstdc++-v3/testsuite/20_util/is_signed/value.cc12
-rw-r--r--libstdc++-v3/testsuite/20_util/is_unsigned/value.cc12
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc17
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc15
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc17
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc15
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc4
19 files changed, 450 insertions, 22 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 4e0ddf4c191..04161592a6a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,32 @@
+2011-09-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/50441
+ * acinclude.m4 ([GLIBCXX_ENABLE_INT128_FLOAT128]): Add.
+ * configure.ac: Call it.
+ * include/std/type_traits (__is_integral_helper<__int128_t>,
+ __is_integral_helper<__uint128_t>,
+ __is_floating_point_helper<__float128>,
+ __make_unsigned<__int128_t>, __make_signed<__uint128_t>): Add.
+ * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Extend.
+ * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise.
+ * testsuite/20_util/is_signed/value.cc: Likewise.
+ * testsuite/20_util/is_unsigned/value.cc: Likewise.
+ * testsuite/20_util/is_integral/value.cc: Likewise.
+ * testsuite/20_util/is_floating_point/value.cc: New.
+ * testsuite/20_util/is_floating_point/requirements/typedefs.cc:
+ Likewise.
+ * testsuite/20_util/is_floating_point/requirements/
+ explicit_instantiation.cc: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
+ dg-error line numbers.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
+ Likewise.
+ * testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
2011-09-17 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable.h (_Hashtable<>::__rehash_policy(const
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index a3e059864d1..543f684f458 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2419,6 +2419,82 @@ EOF
])
dnl
+dnl Check for GNU 128-bit integer and floating point types.
+dnl
+dnl Note: also checks that the types aren't standard types.
+dnl
+dnl Defines:
+dnl _GLIBCXX_USE_INT128
+dnl _GLIBCXX_USE_FLOAT128
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_INT128_FLOAT128], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Fake what AC_TRY_COMPILE does, without linking as this is
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<long, __int128_t>::type i1;
+ typename same<unsigned long, __uint128_t>::type u1;
+ typename same<long long, __int128_t>::type i2;
+ typename same<unsigned long long, __uint128_t>::type u2;
+}
+EOF
+
+ AC_MSG_CHECKING([for __int128_t and __uint128_t])
+ if AC_TRY_EVAL(ac_compile); then
+ AC_DEFINE(_GLIBCXX_USE_INT128, 1,
+ [Define if __int128_t and __uint128_t types are supported on this host.])
+ enable_int128=yes
+ else
+ enable_int128=no
+ fi
+ AC_MSG_RESULT($enable_int128)
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<double, __float128>::type f1;
+ typename same<long double, __float128>::type f2;
+}
+EOF
+
+ AC_MSG_CHECKING([for __float128])
+ if AC_TRY_EVAL(ac_compile); then
+ AC_DEFINE(_GLIBCXX_USE_FLOAT128, 1,
+ [Define if __float128 is supported on this host.])
+ enable_float128=yes
+ else
+ enable_float128=no
+ fi
+ AC_MSG_RESULT($enable_float128)
+ rm -f conftest*
+
+ AC_LANG_RESTORE
+])
+
+dnl
dnl Check for template specializations for the 'wchar_t' type.
dnl
dnl --enable-wchar_t defines _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 167f574ffc5..19a40b8aed4 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -807,12 +807,18 @@
this host. */
#undef _GLIBCXX_USE_DECIMAL_FLOAT
+/* Define if __float128 is supported on this host. */
+#undef _GLIBCXX_USE_FLOAT128
+
/* Defined if gettimeofday is available. */
#undef _GLIBCXX_USE_GETTIMEOFDAY
/* Define if get_nprocs is available in <sys/sysinfo.h>. */
#undef _GLIBCXX_USE_GET_NPROCS
+/* Define if __int128_t and __uint128_t types are supported on this host. */
+#undef _GLIBCXX_USE_INT128
+
/* Define if LFS support is available. */
#undef _GLIBCXX_USE_LFS
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index c160bd99c11..5eb278ac758 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -15538,6 +15538,96 @@ $as_echo "$enable_dfp" >&6; }
rm -f conftest*
+
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ # Fake what AC_TRY_COMPILE does, without linking as this is
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+#line 15554 "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<long, __int128_t>::type i1;
+ typename same<unsigned long, __uint128_t>::type u1;
+ typename same<long long, __int128_t>::type i2;
+ typename same<unsigned long long, __uint128_t>::type u2;
+}
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128_t and __uint128_t" >&5
+$as_echo_n "checking for __int128_t and __uint128_t... " >&6; }
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+
+$as_echo "#define _GLIBCXX_USE_INT128 1" >>confdefs.h
+
+ enable_int128=yes
+ else
+ enable_int128=no
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_int128" >&5
+$as_echo "$enable_int128" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+#line 15590 "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<double, __float128>::type f1;
+ typename same<long double, __float128>::type f2;
+}
+EOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __float128" >&5
+$as_echo_n "checking for __float128... " >&6; }
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+
+$as_echo "#define _GLIBCXX_USE_FLOAT128 1" >>confdefs.h
+
+ enable_float128=yes
+ else
+ enable_float128=no
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float128" >&5
+$as_echo "$enable_float128" >&6; }
+ rm -f conftest*
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
# Checks for compiler support that doesn't require linking.
# All these tests are for C++; save the language and the compiler flags.
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 6e7fea656bc..8b528baaf97 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -114,6 +114,7 @@ GLIBCXX_ENABLE_PCH($is_hosted)
GLIBCXX_ENABLE_THREADS
GLIBCXX_ENABLE_ATOMIC_BUILTINS
GLIBCXX_ENABLE_DECIMAL_FLOAT
+GLIBCXX_ENABLE_INT128_FLOAT128
# Checks for compiler support that doesn't require linking.
GLIBCXX_CHECK_COMPILER_FEATURES
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 155f7dfe6b9..a03fb34e26e 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -213,6 +213,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_integral_helper<unsigned long long>
: public true_type { };
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
+ template<>
+ struct __is_integral_helper<__int128_t>
+ : public true_type { };
+
+ template<>
+ struct __is_integral_helper<__uint128_t>
+ : public true_type { };
+#endif
+
/// is_integral
template<typename _Tp>
struct is_integral
@@ -236,6 +246,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_floating_point_helper<long double>
: public true_type { };
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+ template<>
+ struct __is_floating_point_helper<__float128>
+ : public true_type { };
+#endif
+
/// is_floating_point
template<typename _Tp>
struct is_floating_point
@@ -1398,6 +1414,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __make_unsigned<long long>
{ typedef unsigned long long __type; };
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
+ template<>
+ struct __make_unsigned<__int128_t>
+ { typedef __uint128_t __type; };
+#endif
+
// Select between integral and enum: not possible to be both.
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
@@ -1474,6 +1496,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __make_signed<unsigned long long>
{ typedef signed long long __type; };
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
+ template<>
+ struct __make_signed<__uint128_t>
+ { typedef __int128_t __type; };
+#endif
+
// Select between integral and enum: not possible to be both.
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
index 195b9c29173..1f4065b92a8 100644
--- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
@@ -19,7 +19,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 1731 }
+// { dg-error "static assertion failed" "" { target *-*-* } 1759 }
#include <utility>
diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/explicit_instantiation.cc
new file mode 100644
index 00000000000..cbfd12e8f38
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/explicit_instantiation.cc
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+ typedef short test_type;
+ template struct is_floating_point<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/typedefs.cc
new file mode 100644
index 00000000000..b878ffb03d5
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_floating_point/requirements/typedefs.cc
@@ -0,0 +1,35 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+//
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::is_floating_point<int> test_type;
+ typedef test_type::value_type value_type;
+ typedef test_type::type type;
+ typedef test_type::type::value_type type_value_type;
+ typedef test_type::type::type type_type;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc
new file mode 100644
index 00000000000..8f11924ae25
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc
@@ -0,0 +1,68 @@
+// { dg-options "-std=gnu++0x" }
+//
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using std::is_floating_point;
+ using namespace __gnu_test;
+
+ VERIFY( (test_category<is_floating_point, void>(false)) );
+ VERIFY( (test_category<is_floating_point, char>(false)) );
+ VERIFY( (test_category<is_floating_point, signed char>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned char>(false)) );
+#ifdef _GLIBCXX_USE_WCHAR_T
+ VERIFY( (test_category<is_floating_point, wchar_t>(false)) );
+#endif
+ VERIFY( (test_category<is_floating_point, short>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned short>(false)) );
+ VERIFY( (test_category<is_floating_point, int>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned int>(false)) );
+ VERIFY( (test_category<is_floating_point, long>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned long>(false)) );
+ VERIFY( (test_category<is_floating_point, long long>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned long long>(false)) );
+
+ VERIFY( (test_category<is_floating_point, float>(true)) );
+ VERIFY( (test_category<is_floating_point, double>(true)) );
+ VERIFY( (test_category<is_floating_point, long double>(true)) );
+
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_FLOAT128
+ VERIFY( (test_category<is_floating_point, __float128>(true)) );
+#endif
+
+#ifdef _GLIBCXX_USE_INT128
+ VERIFY( (test_category<is_floating_point, __int128_t>(false)) );
+ VERIFY( (test_category<is_floating_point, __uint128_t>(false)) );
+#endif
+
+ // Sanity check.
+ VERIFY( (test_category<is_floating_point, ClassType>(false)) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_integral/value.cc b/libstdc++-v3/testsuite/20_util/is_integral/value.cc
index 6b1717b381c..04a91091ad0 100644
--- a/libstdc++-v3/testsuite/20_util/is_integral/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_integral/value.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// 2008-05-20 Paolo Carlini <paolo.carlini@oracle.com>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -51,6 +51,16 @@ void test01()
VERIFY( (test_category<is_integral, double>(false)) );
VERIFY( (test_category<is_integral, long double>(false)) );
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ VERIFY( (test_category<is_integral, __int128_t>(true)) );
+ VERIFY( (test_category<is_integral, __uint128_t>(true)) );
+#endif
+
+#ifdef _GLIBCXX_USE_FLOAT128
+ VERIFY( (test_category<is_integral, __float128>(false)) );
+#endif
+
// Sanity check.
VERIFY( (test_category<is_integral, ClassType>(false)) );
}
diff --git a/libstdc++-v3/testsuite/20_util/is_signed/value.cc b/libstdc++-v3/testsuite/20_util/is_signed/value.cc
index 194e268b68c..f407b42a9a9 100644
--- a/libstdc++-v3/testsuite/20_util/is_signed/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_signed/value.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// 2005-01-24 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -49,6 +49,16 @@ void test01()
VERIFY( (test_category<is_signed, double>(true)) );
VERIFY( (test_category<is_signed, long double>(true)) );
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ VERIFY( (test_category<is_signed, __int128_t>(true)) );
+ VERIFY( (test_category<is_signed, __uint128_t>(false)) );
+#endif
+
+#ifdef _GLIBCXX_USE_FLOAT128
+ VERIFY( (test_category<is_signed, __float128>(true)) );
+#endif
+
// Sanity check.
VERIFY( (test_category<is_signed, ClassType>(false)) );
}
diff --git a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
index 5163cf975b1..7628c993653 100644
--- a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// 2005-01-24 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -49,6 +49,16 @@ void test01()
VERIFY( (test_category<is_unsigned, double>(false)) );
VERIFY( (test_category<is_unsigned, long double>(false)) );
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ VERIFY( (test_category<is_unsigned, __uint128_t>(true)) );
+ VERIFY( (test_category<is_unsigned, __int128_t>(false)) );
+#endif
+
+#ifdef _GLIBCXX_USE_FLOAT128
+ VERIFY( (test_category<is_unsigned, __float128>(false)) );
+#endif
+
// Sanity check.
VERIFY( (test_category<is_unsigned, ClassType>(false)) );
}
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
index 6c21a1e753c..28d17af8ad3 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
@@ -2,7 +2,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,9 +53,18 @@ void test01()
#endif
// Chapter 48, chapter 20. Smallest rank such that new signed type same size.
- typedef make_signed<test_enum>::type test25_type;
- VERIFY( is_signed<test25_type>::value );
- VERIFY( sizeof(test25_type) == sizeof(test_enum) );
+ typedef make_signed<test_enum>::type test24_type;
+ VERIFY( is_signed<test24_type>::value );
+ VERIFY( sizeof(test24_type) == sizeof(test_enum) );
+
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ typedef make_signed<__uint128_t>::type test25_type;
+ VERIFY( (is_same<test25_type, __int128_t>::value) );
+
+ typedef make_signed<__int128_t>::type test26_type;
+ VERIFY( (is_same<test26_type, __int128_t>::value) );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
index cb40b7bff07..209ea61013c 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
@@ -3,7 +3,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,8 +53,17 @@ void test01()
VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
#endif
- typedef make_signed<test_enum>::type test25_type;
- VERIFY( (is_same<test25_type, short>::value) );
+ typedef make_signed<test_enum>::type test24_type;
+ VERIFY( (is_same<test24_type, short>::value) );
+
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ typedef make_signed<__uint128_t>::type test25_type;
+ VERIFY( (is_same<test25_type, __int128_t>::value) );
+
+ typedef make_signed<__int128_t>::type test26_type;
+ VERIFY( (is_same<test26_type, __int128_t>::value) );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index b3266580f5f..d61daf35853 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1517 }
-// { dg-error "declaration of" "" { target *-*-* } 1481 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1545 }
+// { dg-error "declaration of" "" { target *-*-* } 1509 }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
index 9d96d5b8974..021ac7e2f4f 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
@@ -2,7 +2,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -54,9 +54,18 @@ void test01()
// Chapter 48, chapter 20. Smallest rank such that new unsigned type
// same size.
- typedef make_unsigned<test_enum>::type test25_type;
- VERIFY( is_unsigned<test25_type>::value );
- VERIFY( sizeof(test25_type) == sizeof(test_enum) );
+ typedef make_unsigned<test_enum>::type test24_type;
+ VERIFY( is_unsigned<test24_type>::value );
+ VERIFY( sizeof(test24_type) == sizeof(test_enum) );
+
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ typedef make_unsigned<__uint128_t>::type test25_type;
+ VERIFY( (is_same<test25_type, __uint128_t>::value) );
+
+ typedef make_unsigned<__int128_t>::type test26_type;
+ VERIFY( (is_same<test26_type, __uint128_t>::value) );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
index d71c0128228..da572624135 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
@@ -3,7 +3,7 @@
// 2007-05-03 Benjamin Kosnik <bkoz@redhat.com>
//
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,8 +53,17 @@ void test01()
VERIFY( (is_same<test23_type, volatile wchar_t>::value) );
#endif
- typedef make_unsigned<test_enum>::type test25_type;
- VERIFY( (is_same<test25_type, unsigned short>::value) );
+ typedef make_unsigned<test_enum>::type test24_type;
+ VERIFY( (is_same<test24_type, unsigned short>::value) );
+
+ // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+ typedef make_unsigned<__uint128_t>::type test25_type;
+ VERIFY( (is_same<test25_type, __uint128_t>::value) );
+
+ typedef make_unsigned<__int128_t>::type test26_type;
+ VERIFY( (is_same<test26_type, __uint128_t>::value) );
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index 3de08b30aa3..ee74be9f267 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1441 }
-// { dg-error "declaration of" "" { target *-*-* } 1405 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1463 }
+// { dg-error "declaration of" "" { target *-*-* } 1427 }