summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath')
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc62
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc193
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc257
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc64
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc34
5 files changed, 610 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc
new file mode 100644
index 000000000..504305a30
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc
@@ -0,0 +1,62 @@
+// { 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 <tr1/cmath>
+
+namespace a
+{
+ template<typename> class Mat { };
+
+ template<typename T> struct Mat2 : Mat<T> { };
+
+ template<typename T>
+ int fdim(Mat<T>) { return 1; }
+
+ template<typename T, typename U>
+ int floor(Mat<T>, U) { return 1; }
+ template<typename T, typename U>
+ int floor(T, Mat<U>) { return 1; }
+
+ template<typename T, typename U, typename V>
+ int fma(Mat<T>, U, V) { return 1; }
+ template<typename T, typename U, typename V>
+ int fma(T, Mat<U>, V) { return 1; }
+ template<typename T, typename U, typename V>
+ int fma(T, U, Mat<V>) { return 1; }
+}
+
+int main()
+{
+ int __attribute__((unused)) i;
+
+ using namespace std::tr1;
+
+ a::Mat2<double> c;
+ i = fdim(c);
+ i = floor(c, 0.);
+ i = floor(0., c);
+ i = floor(c, 1);
+ i = floor(1, c);
+ i = fma(c, 0., 1.);
+ i = fma(0., c, 1.);
+ i = fma(0., 1., c);
+ i = fma(c, 0., 1);
+ i = fma(0., c, 1);
+ i = fma(0., 1, c);
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc
new file mode 100644
index 000000000..ae31a48ec
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc
@@ -0,0 +1,193 @@
+// { dg-do compile }
+
+// 2006-02-07 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2006, 2007, 2008, 2009, 2010 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/>.
+
+// 8.16 Additions to header <cmath>
+
+#include <tr1/cmath>
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ double d0 = 0.0;
+ float f0 = 0.0f;
+ long double ld0 = 0.0l;
+ const char* str = "NAN";
+ int* pquo = 0;
+ long lex = 0l;
+ int ex = 0;
+
+ double ret;
+ float fret;
+ long double ldret;
+ int iret;
+ long lret;
+ long long llret;
+
+ ret = std::tr1::acosh(d0);
+ fret = std::tr1::acoshf(f0);
+ ldret = std::tr1::acoshl(ld0);
+
+ ret = std::tr1::asinh(d0);
+ fret = std::tr1::asinhf(f0);
+ ldret = std::tr1::asinhl(ld0);
+
+ ret = std::tr1::atanh(d0);
+ fret = std::tr1::atanhf(f0);
+ ldret = std::tr1::atanhl(ld0);
+
+ ret = std::tr1::cbrt(d0);
+ fret = std::tr1::cbrtf(f0);
+ ldret = std::tr1::cbrtl(ld0);
+
+ ret = std::tr1::copysign(d0, d0);
+ fret = std::tr1::copysignf(f0, f0);
+ ldret = std::tr1::copysignl(ld0, ld0);
+
+ ret = std::tr1::erf(d0);
+ fret = std::tr1::erff(f0);
+ ldret = std::tr1::erfl(ld0);
+
+ ret = std::tr1::erfc(d0);
+ fret = std::tr1::erfcf(f0);
+ ldret = std::tr1::erfcl(ld0);
+
+ ret = std::tr1::exp2(d0);
+ fret = std::tr1::exp2f(f0);
+ ldret = std::tr1::exp2l(ld0);
+
+ ret = std::tr1::expm1(d0);
+ fret = std::tr1::expm1f(f0);
+ ldret = std::tr1::expm1l(ld0);
+
+ ret = std::tr1::fdim(d0, d0);
+ fret = std::tr1::fdimf(f0, f0);
+ ldret = std::tr1::fdiml(ld0, ld0);
+
+ ret = std::tr1::fma(d0, d0, d0);
+ fret = std::tr1::fmaf(f0, f0, f0);
+ ldret = std::tr1::fmal(ld0, ld0, ld0);
+
+ ret = std::tr1::fmax(d0, d0);
+ fret = std::tr1::fmaxf(f0, f0);
+ ldret = std::tr1::fmaxl(ld0, ld0);
+
+ ret = std::tr1::fmin(d0, d0);
+ fret = std::tr1::fminf(f0, f0);
+ ldret = std::tr1::fminl(ld0, ld0);
+
+ ret = std::tr1::hypot(d0, d0);
+ fret = std::tr1::hypotf(f0, f0);
+ ldret = std::tr1::hypotl(ld0, ld0);
+
+ iret = std::tr1::ilogb(d0);
+ iret = std::tr1::ilogbf(f0);
+ iret = std::tr1::ilogbl(ld0);
+
+ ret = std::tr1::lgamma(d0);
+ fret = std::tr1::lgammaf(f0);
+ ldret = std::tr1::lgammal(ld0);
+
+ llret = std::tr1::llrint(d0);
+ llret = std::tr1::llrintf(f0);
+ llret = std::tr1::llrintl(ld0);
+
+ llret = std::tr1::llround(d0);
+ llret = std::tr1::llroundf(f0);
+ llret = std::tr1::llroundl(ld0);
+
+ ret = std::tr1::log1p(d0);
+ fret = std::tr1::log1pf(f0);
+ ldret = std::tr1::log1pl(ld0);
+
+ ret = std::tr1::log2(d0);
+ fret = std::tr1::log2f(f0);
+ ldret = std::tr1::log2l(ld0);
+
+ ret = std::tr1::logb(d0);
+ fret = std::tr1::logbf(f0);
+ ldret = std::tr1::logbl(ld0);
+
+ lret = std::tr1::lrint(d0);
+ lret = std::tr1::lrintf(f0);
+ lret = std::tr1::lrintl(ld0);
+
+ lret = std::tr1::lround(d0);
+ lret = std::tr1::lroundf(f0);
+ lret = std::tr1::lroundl(ld0);
+
+ ret = std::tr1::nan(str);
+ fret = std::tr1::nanf(str);
+ ldret = std::tr1::nanl(str);
+
+ ret = std::tr1::nearbyint(d0);
+ fret = std::tr1::nearbyintf(f0);
+ ldret = std::tr1::nearbyintl(ld0);
+
+ ret = std::tr1::nextafter(d0, d0);
+ fret = std::tr1::nextafterf(f0, f0);
+ ldret = std::tr1::nextafterl(ld0, ld0);
+
+ ret = std::tr1::nexttoward(d0, ld0);
+ fret = std::tr1::nexttowardf(f0, ld0);
+ ldret = std::tr1::nexttowardl(ld0, ld0);
+
+ ret = std::tr1::remainder(d0, d0);
+ fret = std::tr1::remainderf(f0, f0);
+ ldret = std::tr1::remainderl(ld0, ld0);
+
+ ret = std::tr1::remquo(d0, d0, pquo);
+ fret = std::tr1::remquof(f0, f0, pquo);
+ ldret = std::tr1::remquol(ld0, ld0, pquo);
+
+ ret = std::tr1::rint(d0);
+ fret = std::tr1::rintf(f0);
+ ldret = std::tr1::rintl(ld0);
+
+ ret = std::tr1::round(d0);
+ fret = std::tr1::roundf(f0);
+ ldret = std::tr1::roundl(ld0);
+
+ ret = std::tr1::scalbln(d0, lex);
+ fret = std::tr1::scalblnf(f0, lex);
+ ldret = std::tr1::scalblnl(ld0, lex);
+
+ ret = std::tr1::scalbn(d0, ex);
+ fret = std::tr1::scalbnf(f0, ex);
+ ldret = std::tr1::scalbnl(ld0, ex);
+
+ ret = std::tr1::tgamma(d0);
+ fret = std::tr1::tgammaf(f0);
+ ldret = std::tr1::tgammal(ld0);
+
+ ret = std::tr1::trunc(d0);
+ fret = std::tr1::truncf(f0);
+ ldret = std::tr1::truncl(ld0);
+
+ ret = ret; // Suppress unused warnings.
+ iret = iret;
+ lret = lret;
+ llret = llret;
+ fret = fret;
+ ldret = ldret;
+
+#endif
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc
new file mode 100644
index 000000000..04bc91275
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc
@@ -0,0 +1,257 @@
+// { dg-do compile }
+
+// 2006-03-07 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2006, 2009 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/>.
+
+// 8.16.4 Additional overloads
+
+#include <tr1/cmath>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ using namespace __gnu_test;
+
+ double d0 = 0.0;
+ float f0 = 0.0f;
+ long double ld0 = 0.0l;
+ int i0 = 0;
+ int* pquo = 0;
+ long lex = 0l;
+ int ex = 0;
+
+ check_ret_type<double>(std::tr1::atan2(d0, d0));
+ check_ret_type<double>(std::tr1::atan2(d0, f0));
+ check_ret_type<float>(std::tr1::atan2(f0, f0));
+ check_ret_type<long double>(std::tr1::atan2(ld0, ld0));
+ check_ret_type<long double>(std::tr1::atan2(ld0, d0));
+ check_ret_type<double>(std::tr1::atan2(i0, i0));
+ check_ret_type<double>(std::tr1::atan2(d0, i0));
+
+ check_ret_type<double>(std::tr1::acosh(d0));
+ check_ret_type<float>(std::tr1::acosh(f0));
+ check_ret_type<long double>(std::tr1::acosh(ld0));
+ check_ret_type<double>(std::tr1::acosh(i0));
+
+ check_ret_type<double>(std::tr1::asinh(d0));
+ check_ret_type<float>(std::tr1::asinh(f0));
+ check_ret_type<long double>(std::tr1::asinh(ld0));
+ check_ret_type<double>(std::tr1::asinh(i0));
+
+ check_ret_type<double>(std::tr1::atanh(d0));
+ check_ret_type<float>(std::tr1::atanh(f0));
+ check_ret_type<long double>(std::tr1::atanh(ld0));
+ check_ret_type<double>(std::tr1::atanh(i0));
+
+ check_ret_type<double>(std::tr1::cbrt(d0));
+ check_ret_type<float>(std::tr1::cbrt(f0));
+ check_ret_type<long double>(std::tr1::cbrt(ld0));
+ check_ret_type<double>(std::tr1::cbrt(i0));
+
+ check_ret_type<double>(std::tr1::copysign(d0, d0));
+ check_ret_type<double>(std::tr1::copysign(d0, f0));
+ check_ret_type<float>(std::tr1::copysign(f0, f0));
+ check_ret_type<long double>(std::tr1::copysign(ld0, ld0));
+ check_ret_type<long double>(std::tr1::copysign(ld0, d0));
+ check_ret_type<double>(std::tr1::copysign(i0, i0));
+ check_ret_type<double>(std::tr1::copysign(d0, i0));
+
+ check_ret_type<double>(std::tr1::erf(d0));
+ check_ret_type<float>(std::tr1::erf(f0));
+ check_ret_type<long double>(std::tr1::erf(ld0));
+ check_ret_type<double>(std::tr1::erf(i0));
+
+ check_ret_type<double>(std::tr1::erfc(d0));
+ check_ret_type<float>(std::tr1::erfc(f0));
+ check_ret_type<long double>(std::tr1::erfc(ld0));
+ check_ret_type<double>(std::tr1::erfc(i0));
+
+ check_ret_type<double>(std::tr1::exp2(d0));
+ check_ret_type<float>(std::tr1::exp2(f0));
+ check_ret_type<long double>(std::tr1::exp2(ld0));
+ check_ret_type<double>(std::tr1::exp2(i0));
+
+ check_ret_type<double>(std::tr1::expm1(d0));
+ check_ret_type<float>(std::tr1::expm1(f0));
+ check_ret_type<long double>(std::tr1::expm1(ld0));
+ check_ret_type<double>(std::tr1::expm1(i0));
+
+ check_ret_type<double>(std::tr1::fdim(d0, d0));
+ check_ret_type<double>(std::tr1::fdim(d0, f0));
+ check_ret_type<float>(std::tr1::fdim(f0, f0));
+ check_ret_type<long double>(std::tr1::fdim(ld0, ld0));
+ check_ret_type<long double>(std::tr1::fdim(ld0, d0));
+ check_ret_type<double>(std::tr1::fdim(i0, i0));
+ check_ret_type<double>(std::tr1::fdim(d0, i0));
+
+ check_ret_type<double>(std::tr1::fma(d0, d0, d0));
+ check_ret_type<double>(std::tr1::fma(d0, f0, d0));
+ check_ret_type<float>(std::tr1::fma(f0, f0, f0));
+ check_ret_type<long double>(std::tr1::fma(ld0, ld0, ld0));
+ check_ret_type<long double>(std::tr1::fma(ld0, d0, f0));
+ check_ret_type<double>(std::tr1::fma(i0, i0, i0));
+ check_ret_type<double>(std::tr1::fma(d0, i0, f0));
+
+ check_ret_type<double>(std::tr1::fmax(d0, d0));
+ check_ret_type<double>(std::tr1::fmax(d0, f0));
+ check_ret_type<float>(std::tr1::fmax(f0, f0));
+ check_ret_type<long double>(std::tr1::fmax(ld0, ld0));
+ check_ret_type<long double>(std::tr1::fmax(ld0, d0));
+ check_ret_type<double>(std::tr1::fmax(i0, i0));
+ check_ret_type<double>(std::tr1::fmax(d0, i0));
+
+ check_ret_type<double>(std::tr1::fmin(d0, d0));
+ check_ret_type<double>(std::tr1::fmin(d0, f0));
+ check_ret_type<float>(std::tr1::fmin(f0, f0));
+ check_ret_type<long double>(std::tr1::fmin(ld0, ld0));
+ check_ret_type<long double>(std::tr1::fmin(ld0, d0));
+ check_ret_type<double>(std::tr1::fmin(i0, i0));
+ check_ret_type<double>(std::tr1::fmin(d0, i0));
+
+ check_ret_type<double>(std::tr1::hypot(d0, d0));
+ check_ret_type<double>(std::tr1::hypot(d0, f0));
+ check_ret_type<float>(std::tr1::hypot(f0, f0));
+ check_ret_type<long double>(std::tr1::hypot(ld0, ld0));
+ check_ret_type<long double>(std::tr1::hypot(ld0, d0));
+ check_ret_type<double>(std::tr1::hypot(i0, i0));
+ check_ret_type<double>(std::tr1::hypot(d0, i0));
+
+ check_ret_type<int>(std::tr1::ilogb(d0));
+ check_ret_type<int>(std::tr1::ilogb(f0));
+ check_ret_type<int>(std::tr1::ilogb(ld0));
+ check_ret_type<int>(std::tr1::ilogb(i0));
+
+ check_ret_type<double>(std::tr1::lgamma(d0));
+ check_ret_type<float>(std::tr1::lgamma(f0));
+ check_ret_type<long double>(std::tr1::lgamma(ld0));
+ check_ret_type<double>(std::tr1::lgamma(i0));
+
+ check_ret_type<long long>(std::tr1::llrint(d0));
+ check_ret_type<long long>(std::tr1::llrint(f0));
+ check_ret_type<long long>(std::tr1::llrint(ld0));
+ check_ret_type<long long>(std::tr1::llrint(i0));
+
+ check_ret_type<long long>(std::tr1::llround(d0));
+ check_ret_type<long long>(std::tr1::llround(f0));
+ check_ret_type<long long>(std::tr1::llround(ld0));
+ check_ret_type<long long>(std::tr1::llround(i0));
+
+ check_ret_type<double>(std::tr1::log1p(d0));
+ check_ret_type<float>(std::tr1::log1p(f0));
+ check_ret_type<long double>(std::tr1::log1p(ld0));
+ check_ret_type<double>(std::tr1::log1p(i0));
+
+ // DR 568.
+ check_ret_type<double>(std::tr1::log2(d0));
+ check_ret_type<float>(std::tr1::log2(f0));
+ check_ret_type<long double>(std::tr1::log2(ld0));
+ check_ret_type<double>(std::tr1::log2(i0));
+
+ check_ret_type<double>(std::tr1::logb(d0));
+ check_ret_type<float>(std::tr1::logb(f0));
+ check_ret_type<long double>(std::tr1::logb(ld0));
+ check_ret_type<double>(std::tr1::logb(i0));
+
+ check_ret_type<long>(std::tr1::lrint(d0));
+ check_ret_type<long>(std::tr1::lrint(f0));
+ check_ret_type<long>(std::tr1::lrint(ld0));
+ check_ret_type<long>(std::tr1::lrint(i0));
+
+ check_ret_type<long>(std::tr1::lround(d0));
+ check_ret_type<long>(std::tr1::lround(f0));
+ check_ret_type<long>(std::tr1::lround(ld0));
+ check_ret_type<long>(std::tr1::lround(i0));
+
+ check_ret_type<double>(std::tr1::nearbyint(d0));
+ check_ret_type<float>(std::tr1::nearbyint(f0));
+ check_ret_type<long double>(std::tr1::nearbyint(ld0));
+ check_ret_type<double>(std::tr1::nearbyint(i0));
+
+ check_ret_type<double>(std::tr1::nextafter(d0, d0));
+ check_ret_type<double>(std::tr1::nextafter(d0, f0));
+ check_ret_type<float>(std::tr1::nextafter(f0, f0));
+ check_ret_type<long double>(std::tr1::nextafter(ld0, ld0));
+ check_ret_type<long double>(std::tr1::nextafter(ld0, d0));
+ check_ret_type<double>(std::tr1::nextafter(i0, i0));
+ check_ret_type<double>(std::tr1::nextafter(d0, i0));
+
+ check_ret_type<double>(std::tr1::nexttoward(d0, ld0));
+ check_ret_type<float>(std::tr1::nexttoward(f0, ld0));
+ check_ret_type<long double>(std::tr1::nexttoward(ld0, ld0));
+ check_ret_type<double>(std::tr1::nexttoward(i0, ld0));
+
+ check_ret_type<double>(std::tr1::pow(d0, d0));
+ check_ret_type<double>(std::tr1::pow(d0, f0));
+ check_ret_type<float>(std::tr1::pow(f0, f0));
+ check_ret_type<long double>(std::tr1::pow(ld0, ld0));
+ check_ret_type<long double>(std::tr1::pow(ld0, d0));
+ check_ret_type<double>(std::tr1::pow(i0, i0));
+ check_ret_type<double>(std::tr1::pow(d0, i0));
+ check_ret_type<double>(std::tr1::pow(f0, i0));
+
+ check_ret_type<double>(std::tr1::remainder(d0, d0));
+ check_ret_type<double>(std::tr1::remainder(d0, f0));
+ check_ret_type<float>(std::tr1::remainder(f0, f0));
+ check_ret_type<long double>(std::tr1::remainder(ld0, ld0));
+ check_ret_type<long double>(std::tr1::remainder(ld0, d0));
+ check_ret_type<double>(std::tr1::remainder(i0, i0));
+ check_ret_type<double>(std::tr1::remainder(d0, i0));
+
+ check_ret_type<double>(std::tr1::remquo(d0, d0, pquo));
+ check_ret_type<double>(std::tr1::remquo(d0, f0, pquo));
+ check_ret_type<float>(std::tr1::remquo(f0, f0, pquo));
+ check_ret_type<long double>(std::tr1::remquo(ld0, ld0, pquo));
+ check_ret_type<long double>(std::tr1::remquo(ld0, d0, pquo));
+ check_ret_type<double>(std::tr1::remquo(i0, i0, pquo));
+ check_ret_type<double>(std::tr1::remquo(d0, i0, pquo));
+
+ check_ret_type<double>(std::tr1::rint(d0));
+ check_ret_type<float>(std::tr1::rint(f0));
+ check_ret_type<long double>(std::tr1::rint(ld0));
+ check_ret_type<double>(std::tr1::rint(i0));
+
+ check_ret_type<double>(std::tr1::round(d0));
+ check_ret_type<float>(std::tr1::round(f0));
+ check_ret_type<long double>(std::tr1::round(ld0));
+ check_ret_type<double>(std::tr1::round(i0));
+
+ check_ret_type<double>(std::tr1::scalbln(d0, lex));
+ check_ret_type<float>(std::tr1::scalbln(f0, lex));
+ check_ret_type<long double>(std::tr1::scalbln(ld0, lex));
+ check_ret_type<double>(std::tr1::scalbln(i0, lex));
+
+ check_ret_type<double>(std::tr1::scalbn(d0, ex));
+ check_ret_type<float>(std::tr1::scalbn(f0, ex));
+ check_ret_type<long double>(std::tr1::scalbn(ld0, ex));
+ check_ret_type<double>(std::tr1::scalbn(i0, ex));
+
+ check_ret_type<double>(std::tr1::tgamma(d0));
+ check_ret_type<float>(std::tr1::tgamma(f0));
+ check_ret_type<long double>(std::tr1::tgamma(ld0));
+ check_ret_type<double>(std::tr1::tgamma(i0));
+
+ check_ret_type<double>(std::tr1::trunc(d0));
+ check_ret_type<float>(std::tr1::trunc(f0));
+ check_ret_type<long double>(std::tr1::trunc(ld0));
+ check_ret_type<double>(std::tr1::trunc(i0));
+
+#endif
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc
new file mode 100644
index 000000000..cbf8c9592
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc
@@ -0,0 +1,64 @@
+// { dg-do compile }
+
+// 2006-02-26 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2006, 2009, 2010 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/>.
+
+// 8.16 Additions to header <cmath>
+
+#include <tr1/cmath>
+
+#if _GLIBCXX_USE_C99
+#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+template<typename T>
+ void test01_do()
+ {
+ T x = T();
+
+ bool ret;
+ int iret;
+
+ ret = std::tr1::signbit(x);
+
+ iret = std::tr1::fpclassify(x);
+ iret = iret; // Suppress unused warning.
+
+ ret = std::tr1::isfinite(x);
+ ret = std::tr1::isinf(x);
+ ret = std::tr1::isnan(x);
+ ret = std::tr1::isnormal(x);
+
+ ret = std::tr1::isgreater(x, x);
+ ret = std::tr1::isgreaterequal(x, x);
+ ret = std::tr1::isless(x, x);
+ ret = std::tr1::islessequal(x, x);
+ ret = std::tr1::islessgreater(x, x);
+ ret = std::tr1::isunordered(x, x);
+ ret = ret; // Suppress unused warning.
+ }
+
+void test01()
+{
+ test01_do<float>();
+ test01_do<double>();
+ test01_do<long double>();
+}
+
+#endif
+#endif
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc
new file mode 100644
index 000000000..8786c8eff
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// 2006-03-10 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2006, 2009 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/>.
+
+// 8.16 Additions to header <cmath>
+
+#include <tr1/cmath>
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ typedef std::tr1::double_t my_double_t;
+ typedef std::tr1::float_t my_float_t;
+
+#endif
+}