From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../26_numerics/headers/ccomplex/std_c++0x_neg.cc | 26 +++++ .../26_numerics/headers/cfenv/std_c++0x_neg.cc | 26 +++++ .../26_numerics/headers/cfenv/types_std_c++0x.cc | 31 +++++ .../testsuite/26_numerics/headers/cmath/19322.cc | 35 ++++++ .../testsuite/26_numerics/headers/cmath/25913.cc | 38 ++++++ .../testsuite/26_numerics/headers/cmath/37582.cc | 35 ++++++ .../headers/cmath/c99_classification_macros_c++.cc | 84 ++++++++++++++ .../cmath/c99_classification_macros_c++0x.cc | 92 +++++++++++++++ .../headers/cmath/c99_classification_macros_c.cc | 51 +++++++++ .../testsuite/26_numerics/headers/cmath/c_math.cc | 70 ++++++++++++ .../26_numerics/headers/cmath/c_math_dynamic.cc | 49 ++++++++ .../testsuite/26_numerics/headers/cmath/dr550.cc | 46 ++++++++ .../26_numerics/headers/cmath/fabs_inline.cc | 36 ++++++ .../26_numerics/headers/cmath/functions_std.cc | 46 ++++++++ .../testsuite/26_numerics/headers/cmath/macros.cc | 27 +++++ .../26_numerics/headers/cmath/overloads.cc | 47 ++++++++ .../testsuite/26_numerics/headers/cmath/powi.cc | 63 ++++++++++ .../26_numerics/headers/cmath/types_std_c++0x.cc | 31 +++++ .../headers/cmath/types_std_c++0x_neg.cc | 73 ++++++++++++ .../26_numerics/headers/complex/synopsis.cc | 87 ++++++++++++++ .../testsuite/26_numerics/headers/cstdlib/13943.cc | 43 +++++++ .../testsuite/26_numerics/headers/cstdlib/2190.cc | 36 ++++++ .../26_numerics/headers/cstdlib/functions_std.cc | 30 +++++ .../26_numerics/headers/cstdlib/macros.cc | 27 +++++ .../26_numerics/headers/cstdlib/types_std.cc | 26 +++++ .../26_numerics/headers/cstdlib/types_std_c++0x.cc | 34 ++++++ .../26_numerics/headers/ctgmath/std_c++0x_neg.cc | 26 +++++ .../headers/numeric/numeric_parallel_mode.cc | 22 ++++ .../headers/numeric/parallel_numeric.cc | 22 ++++ .../headers/numeric/parallel_numeric_mixed1.cc | 48 ++++++++ .../headers/numeric/parallel_numeric_mixed2.cc | 53 +++++++++ .../26_numerics/headers/numeric/synopsis.cc | 64 +++++++++++ .../26_numerics/headers/random/std_c++0x_neg.cc | 26 +++++ .../26_numerics/headers/random/types_std_c++0x.cc | 27 +++++ .../26_numerics/headers/valarray/synopsis.cc | 127 +++++++++++++++++++++ .../26_numerics/headers/valarray/types_std.cc | 26 +++++ 36 files changed, 1630 insertions(+) create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cfenv/types_std_c++0x.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/19322.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/25913.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/37582.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++0x.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/dr550.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/macros.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/overloads.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/powi.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/complex/synopsis.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/2190.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/functions_std.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/macros.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/numeric/numeric_parallel_mode.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed1.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed2.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/random/std_c++0x_neg.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/random/types_std_c++0x.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/valarray/synopsis.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/headers/valarray/types_std.cc (limited to 'libstdc++-v3/testsuite/26_numerics/headers') diff --git a/libstdc++-v3/testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc new file mode 100644 index 000000000..29e8dac5f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +// Copyright (C) 2007, 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 +// . + +#include + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc new file mode 100644 index 000000000..3a1910692 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +// Copyright (C) 2007, 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 +// . + +#include + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cfenv/types_std_c++0x.cc b/libstdc++-v3/testsuite/26_numerics/headers/cfenv/types_std_c++0x.cc new file mode 100644 index 000000000..dbe066ac0 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cfenv/types_std_c++0x.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +void test01() +{ +#if _GLIBCXX_USE_C99_FENV_TR1 + + typedef std::fenv_t my_fenv_t; + typedef std::fexcept_t my_fexcept_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/19322.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/19322.cc new file mode 100644 index 000000000..25494c357 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/19322.cc @@ -0,0 +1,35 @@ +// { dg-require-c-std "" } + +// 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 +// 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 +// . + +#include +#include + +// libstdc++/19322 +void test01() +{ + bool test __attribute__((unused)) = true; + + VERIFY( !std::isnan(3.0) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/25913.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/25913.cc new file mode 100644 index 000000000..025db2c2c --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/25913.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2007, 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 +// . + + +// { dg-do compile } + +#include +#include + +struct employee +: private std::string { }; + +struct manager +: public employee { }; + +bool isnormal(const employee&) +{ return false; } + +// libstdc++/25913 +void test01() +{ + manager m; + isnormal(m); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/37582.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/37582.cc new file mode 100644 index 000000000..0cec658d8 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/37582.cc @@ -0,0 +1,35 @@ +// Copyright (C) 2008, 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 +// . + + +// { dg-do compile } + +#include + +struct foo +{ + foo (double); +}; + +bool operator &&(int, const foo &); + +// libstdc++/37582 +double +test01(double x) +{ + return std::pow (x, 2.0); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++.cc new file mode 100644 index 000000000..3f4b8ba26 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++.cc @@ -0,0 +1,84 @@ +// 2001-04-06 gdr + +// Copyright (C) 2001, 2005, 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 +// . + + +// { dg-do compile { xfail uclibc } } +// { dg-excess-errors "" { target uclibc } } + +#include + +void fpclassify() { } + +void isfinite() { } + +void isinf() { } + +void isnan() { } + +void isnormal() { } + +void signbit() { } + +void isgreater() { } + +void isgreaterequal() { } + +void isless() { } + +void islessequal() { } + +void islessgreater() { } + +void isunordered() { } + +#if _GLIBCXX_USE_C99_MATH +template + void test_c99_classify() + { + bool test __attribute__((unused)) = true; + + typedef _Tp fp_type; + fp_type f1 = 1.0; + fp_type f2 = 3.0; + int res = 0; + + res = std::fpclassify(f1); + res = std::isfinite(f2); + res = std::isinf(f1); + res = std::isnan(f2); + res = std::isnormal(f1); + res = std::signbit(f2); + res = std::isgreater(f1, f2); + res = std::isgreaterequal(f1, f2); + res = std::isless(f1, f2); + res = std::islessequal(f1,f2); + res = std::islessgreater(f1, f2); + res = std::isunordered(f1, f2); + res = res; // Suppress unused warning. + } +#endif + +int main() +{ +#if _GLIBCXX_USE_C99_MATH + test_c99_classify(); + test_c99_classify(); +#endif + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++0x.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++0x.cc new file mode 100644 index 000000000..413fe6925 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++0x.cc @@ -0,0 +1,92 @@ +// Copyright (C) 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 +// . + +// { dg-options "-std=gnu++0x" } +// { dg-do compile { xfail uclibc } } +// { dg-excess-errors "" { target uclibc } } + +#include + +void fpclassify() { } + +void isfinite() { } + +void isinf() { } + +void isnan() { } + +void isnormal() { } + +void signbit() { } + +void isgreater() { } + +void isgreaterequal() { } + +void isless() { } + +void islessequal() { } + +void islessgreater() { } + +void isunordered() { } + +#if _GLIBCXX_USE_C99_MATH +template + void test_c99_classify() + { + bool test __attribute__((unused)) = true; + + typedef _Tp fp_type_one; + typedef _Up fp_type_two; + fp_type_one f1 = 1.0; + fp_type_two f2 = 3.0; + int resi; + bool res; + + resi = std::fpclassify(f1); + res = std::isfinite(f2); + res = std::isinf(f1); + res = std::isnan(f2); + res = std::isnormal(f1); + res = std::signbit(f2); + res = std::isgreater(f1, f2); + res = std::isgreaterequal(f1, f2); + res = std::isless(f1, f2); + res = std::islessequal(f1,f2); + res = std::islessgreater(f1, f2); + res = std::isunordered(f1, f2); + resi = resi; // Suppress unused warning. + res = res; + } +#endif + +int main() +{ +#if _GLIBCXX_USE_C99_MATH + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); + test_c99_classify(); +#endif + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc new file mode 100644 index 000000000..716dda51b --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc @@ -0,0 +1,51 @@ +// 2001-04-06 gdr + +// Copyright (C) 2001, 2005, 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 +// . + +// { dg-do compile } +// { dg-add-options no_pch } + +// { dg-xfail-if "" { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* } || { uclibc || newlib } } { "*" } { "" } } +// { dg-excess-errors "" { target { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* } || { uclibc || newlib } } } } + +#include + +void fpclassify() { } + +void isfinite() { } + +void isinf() { } + +void isnan() { } + +void isnormal() { } + +void signbit() { } + +void isgreater() { } + +void isgreaterequal() { } + +void isless() { } + +void islessequal() { } + +void islessgreater() { } + +void isunordered() { } + diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math.cc new file mode 100644 index 000000000..b8cf6e5e1 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math.cc @@ -0,0 +1,70 @@ +// 1999-06-05 +// Gabriel Dos Reis + +// Copyright (C) 1999, 2000, 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 +// . + +#include +#include + +// test compilation. +int +test01() +{ + float a = 1.f; + float b; + std::modf(a, &b); + return 0; +} + +// need more extravagant checks than this, of course, but this used to core... +int +test02() +{ + std::sin(static_cast(0)); + return 0; +} + +// as did this. +int +test03() +{ + double powtest __attribute__((unused)) = std::pow(2., 0); + return 0; +} + +// this used to abort. +int +test04() +{ + bool test __attribute__((unused)) = true; + float x[2] = {1, 2}; + float y = 3.4; + std::modf(y, &x[0]); + VERIFY(x[1] == 2); + return 0; +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc new file mode 100644 index 000000000..de4dbe39c --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc @@ -0,0 +1,49 @@ +// Inspired by libstdc++/7680 & 26_numerics/c_math.cc, 2003-04-12 ljr + +// Copyright (C) 2003, 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 +// . + + +// { dg-do link } +// { dg-options "-D_XOPEN_SOURCE" { target *-*-freebsd* } } + +#include + +int +test01() +{ + float a = 1.f; + float b; + std::modf(a, &b); + return 0; +} + +int +test02 () +{ + float a = 0.0f; + float b __attribute__((unused)) = std::acos(a); + return 0; +} + +int +main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/dr550.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/dr550.cc new file mode 100644 index 000000000..c8f7c5cc5 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/dr550.cc @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++0x" } +// 2008-05-26 Paolo Carlini +// +// Copyright (C) 2008, 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 +// . + +#include +#include +#include + +// DR 550. What should the return type of pow(float,int) be? +void test01() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::check_ret_type; + + const int i1 = 1; + const float f1 = 1.0f; + const double d1 = 1.0; + const long double ld1 = 1.0l; + + check_ret_type(std::pow(f1, i1)); + VERIFY( std::pow(f1, i1) == std::pow(double(f1), double(i1)) ); + check_ret_type(std::pow(d1, i1)); + check_ret_type(std::pow(ld1, i1)); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc new file mode 100644 index 000000000..17057773e --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/fabs_inline.cc @@ -0,0 +1,36 @@ +// Copyright (C) 1999, 2002, 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 +// . + +// Test to see whether the host provides its own (inline) view of fabs. +// Origin: Kurt Garloff , 2001-05-24 +// dg-do link + +#include +#include + +typedef double (*realfn) (double); + +using std::fabs; + +int main () +{ + double a = fabs (-2.4); + realfn myfn = fabs; + double b = myfn (-2.5); + std::printf ("%f, %f, %p\n", a, b, myfn); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std.cc new file mode 100644 index 000000000..5226ee4eb --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + using std::acos; + using std::asin; + using std::atan; + using std::atan2; + using std::ceil; + using std::cos; + using std::cosh; + using std::exp; + using std::fabs; + using std::floor; + using std::fmod; + using std::frexp; + using std::ldexp; + using std::log; + using std::log10; + using std::modf; + using std::pow; + using std::sin; + using std::sinh; + using std::sqrt; + using std::tan; + using std::tanh; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/macros.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/macros.cc new file mode 100644 index 000000000..754f94402 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/macros.cc @@ -0,0 +1,27 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ +#ifndef HUGE_VAL + #error "HUGE_VAL_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/overloads.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/overloads.cc new file mode 100644 index 000000000..5819e1a18 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/overloads.cc @@ -0,0 +1,47 @@ +// Copyright (C) 2003, 2004, 2005, 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 +// . + +// PR 3181 +// Origin: pete@toyon.com + +#include + +int main() +{ + int i = -1; + int j = 9; + double ans; + ans = std::abs(i); + ans = std::acos(i); + ans = std::asin(i); + ans = std::atan(i); + ans = std::atan2(i, j); + ans = std::cos(i); + ans = std::cosh(i); + ans = std::exp(i); + ans = std::fabs(i); + ans = std::floor(i); + ans = std::log(i); + ans = std::log10(i); + ans = std::sqrt(i); + ans = std::sin(i); + ans = std::sinh(j); + ans = std::tan(i); + ans = std::tanh(i); + ans = ans; // Suppress unused warnings. +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/powi.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/powi.cc new file mode 100644 index 000000000..2af912357 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/powi.cc @@ -0,0 +1,63 @@ +// 2005-02-13 Paolo Carlini + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// 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 +// . + +// 26.5 C Library + +#include +#include + +template + void test01_do() + { + using namespace std; + bool test __attribute__((unused)) = true; + + VERIFY( pow(T(1.0), 0) == T(1.0) ); + VERIFY( pow(T(2.0), 0) == T(1.0) ); + VERIFY( pow(T(-1.0), 0) == T(1.0) ); + VERIFY( pow(T(-4.0), 0) == T(1.0) ); + + VERIFY( pow(T(1.0), 1) == T(1.0) ); + VERIFY( pow(T(2.0), 1) == T(2.0) ); + VERIFY( pow(T(-1.0), 1) == T(-1.0) ); + VERIFY( pow(T(-4.0), 1) == T(-4.0) ); + + VERIFY( pow(T(1.0), -1) == T(1.0) / T(1.0) ); + VERIFY( pow(T(2.0), -1) == T(1.0) / T(2.0) ); + VERIFY( pow(T(-1.0), -1) == T(1.0) / T(-1.0) ); + VERIFY( pow(T(-4.0), -1) == T(1.0) / T(-4.0) ); + + VERIFY( pow(T(1.0), 2) == T(1.0) * T(1.0) ); + VERIFY( pow(T(2.0), 2) == T(2.0) * T(2.0) ); + VERIFY( pow(T(-1.0), 2) == T(-1.0) * T(-1.0) ); + VERIFY( pow(T(-4.0), 2) == T(-4.0) * T(-4.0) ); + } + +void test01() +{ + test01_do(); + test01_do(); + test01_do(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x.cc new file mode 100644 index 000000000..7e4abe90e --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +void test01() +{ +#if _GLIBCXX_USE_C99_MATH_TR1 + + typedef std::double_t my_double_t; + typedef std::float_t my_float_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc new file mode 100644 index 000000000..27fd15cde --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc @@ -0,0 +1,73 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + // C++0x changes from TR1. + using std::assoc_laguerre; + using std::assoc_legendre; + using std::beta; + using std::comp_ellint_1; + using std::comp_ellint_2; + using std::comp_ellint_3; + using std::conf_hyperg; + using std::cyl_bessel_i; + using std::cyl_bessel_j; + using std::cyl_bessel_k; + using std::cyl_neumann; + using std::ellint_1; + using std::ellint_2; + using std::ellint_3; + using std::expint; + using std::hermite; + using std::hyperg; + using std::laguerre; + using std::legendre; + using std::riemann_zeta; + using std::sph_bessel; + using std::sph_legendre; + using std::sph_neumann; +} + +// { dg-error "has not been declared" "" { target *-*-* } 26 } +// { dg-error "has not been declared" "" { target *-*-* } 27 } +// { dg-error "has not been declared" "" { target *-*-* } 28 } +// { dg-error "has not been declared" "" { target *-*-* } 29 } +// { dg-error "has not been declared" "" { target *-*-* } 30 } +// { dg-error "has not been declared" "" { target *-*-* } 31 } +// { dg-error "has not been declared" "" { target *-*-* } 32 } +// { dg-error "has not been declared" "" { target *-*-* } 33 } +// { dg-error "has not been declared" "" { target *-*-* } 34 } +// { dg-error "has not been declared" "" { target *-*-* } 35 } +// { dg-error "has not been declared" "" { target *-*-* } 36 } +// { dg-error "has not been declared" "" { target *-*-* } 37 } +// { dg-error "has not been declared" "" { target *-*-* } 38 } +// { dg-error "has not been declared" "" { target *-*-* } 39 } +// { dg-error "has not been declared" "" { target *-*-* } 40 } +// { dg-error "has not been declared" "" { target *-*-* } 41 } +// { dg-error "has not been declared" "" { target *-*-* } 42 } +// { dg-error "has not been declared" "" { target *-*-* } 43 } +// { dg-error "has not been declared" "" { target *-*-* } 44 } +// { dg-error "has not been declared" "" { target *-*-* } 45 } +// { dg-error "has not been declared" "" { target *-*-* } 46 } +// { dg-error "has not been declared" "" { target *-*-* } 47 } +// { dg-error "has not been declared" "" { target *-*-* } 48 } diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex/synopsis.cc b/libstdc++-v3/testsuite/26_numerics/headers/complex/synopsis.cc new file mode 100644 index 000000000..4d885930b --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex/synopsis.cc @@ -0,0 +1,87 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace std { + template class complex; + template<> class complex; + template<> class complex; + template<> class complex; + + // 26.2.6 operators: + template + complex operator+(const complex&, const complex&); + template complex operator+(const complex&, const T&); + template complex operator+(const T&, const complex&); + template complex operator- + (const complex&, const complex&); + template complex operator-(const complex&, const T&); + template complex operator-(const T&, const complex&); + template complex operator* + (const complex&, const complex&); + template complex operator*(const complex&, const T&); + template complex operator*(const T&, const complex&); + template complex operator/ + (const complex&, const complex&); + template complex operator/(const complex&, const T&); + template complex operator/(const T&, const complex&); + template complex operator+(const complex&); + template complex operator-(const complex&); + template bool operator== + (const complex&, const complex&); + template bool operator==(const complex&, const T&); + template bool operator==(const T&, const complex&); + + + template bool operator!=(const complex&, const complex&); + template bool operator!=(const complex&, const T&); + template bool operator!=(const T&, const complex&); + template + basic_istream& + operator>>(basic_istream&, complex&); + template + basic_ostream& + operator<<(basic_ostream&, const complex&); + + // 26.2.7 values: + template T real(const complex&); + template T imag(const complex&); + template T abs(const complex&); + template T arg(const complex&); + template T norm(const complex&); + template complex conj(const complex&); + template complex polar(const T& rho, const T& theta = 0); + + // 26.2.8 transcendentals: + template complex cos(const complex&); + template complex cosh(const complex&); + template complex exp(const complex&); + template complex log(const complex&); + template complex log10(const complex&); + template complex pow(const complex&, int); + template complex pow(const complex&, const T&); + template complex pow(const complex&, const complex&); + template complex pow(const T&, const complex&); + template complex sin (const complex&); + template complex sinh(const complex&); + template complex sqrt(const complex&); + template complex tan(const complex&); + template complex tanh(const complex&); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc new file mode 100644 index 000000000..ff40cd67c --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc @@ -0,0 +1,43 @@ +// Copyright (C) 2005, 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 +// . + + +#include +#include + +#if _GLIBCXX_USE_C99 +// libstdc++/13943 +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + VERIFY( llabs(-3) == 3 ); + + lldiv_t q = lldiv(6, 4); + VERIFY( q.quot == 1 ); + VERIFY( q.rem == 2 ); +} +#endif + +int main() +{ +#if _GLIBCXX_USE_C99 + test01(); +#endif + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/2190.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/2190.cc new file mode 100644 index 000000000..b3a5075ed --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/2190.cc @@ -0,0 +1,36 @@ +// 2000-01-01 bkoz + +// Copyright (C) 2001, 2002, 2003, 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 +// . + +// 17.4.1.2 Headers, cstdlib + +#include + +// libstdc++/2190 +void test01() +{ + long a __attribute__((unused)) = std::abs(1L); + std::div(2L, 1L); + std::ldiv_t b __attribute__((unused)); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/functions_std.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/functions_std.cc new file mode 100644 index 000000000..b37b588aa --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/functions_std.cc @@ -0,0 +1,30 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + using std::abs; + using std::div; + using std::labs; + using std::ldiv; + using std::srand; + using std::rand; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/macros.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/macros.cc new file mode 100644 index 000000000..5aa0889df --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/macros.cc @@ -0,0 +1,27 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ +#ifndef RAND_MAX + #error "RAND_MAX_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std.cc new file mode 100644 index 000000000..503caf1dd --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + std::div_t d; + std::ldiv_t ld; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc new file mode 100644 index 000000000..0eb8b651a --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +#if _GLIBCXX_HOSTED + +void test01() +{ +#if _GLIBCXX_USE_C99 + + typedef std::lldiv_t my_lldiv_t; + +#endif +} + +#endif diff --git a/libstdc++-v3/testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc new file mode 100644 index 000000000..23b266e85 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +// Copyright (C) 2007, 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 +// . + +#include + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/numeric_parallel_mode.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/numeric_parallel_mode.cc new file mode 100644 index 000000000..3db5fc22a --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/numeric_parallel_mode.cc @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-require-parallel-mode "" } +// { dg-options "-D_GLIBCXX_PARALLEL -fopenmp" { target *-*-* } } + +// Copyright (C) 2007, 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 +// . + +#include diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric.cc new file mode 100644 index 000000000..452f8fe35 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric.cc @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-require-parallel-mode "" } +// { dg-options "-fopenmp" { target *-*-* } } + +// Copyright (C) 2007, 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 +// . + +#include diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed1.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed1.cc new file mode 100644 index 000000000..a1ce8f052 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed1.cc @@ -0,0 +1,48 @@ +// { dg-do compile } +// { dg-require-parallel-mode "" } +// { dg-options "-fopenmp" { target *-*-* } } + +// Copyright (C) 2007, 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 +// . + +#include +#include +#include +#include + +void test() +{ + typedef unsigned short value_type; + typedef std::vector vector_type; + + const value_type c(0); + + vector_type v(10); + + std::accumulate(v.begin(), v.end(), value_type(1)); + std::accumulate(v.begin(), v.end(), value_type(1), std::plus()); + __gnu_parallel::accumulate(v.begin(), v.end(), value_type(1)); + __gnu_parallel::accumulate(v.begin(), v.end(), value_type(1), + std::plus()); + + std::inner_product(v.begin(), v.end(), v.begin(), value_type(1)); + std::inner_product(v.begin(), v.end(), v.begin(), value_type(1), + std::multiplies(), std::plus()); + __gnu_parallel::inner_product(v.begin(), v.end(), v.begin(), value_type(1)); + __gnu_parallel::inner_product(v.begin(), v.end(), v.begin(), value_type(1), + std::multiplies(), std::plus()); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed2.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed2.cc new file mode 100644 index 000000000..a38d92561 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/parallel_numeric_mixed2.cc @@ -0,0 +1,53 @@ +// { dg-do compile } +// { dg-require-parallel-mode "" } +// { dg-options "-fopenmp" { target *-*-* } } + +// Copyright (C) 2007, 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 +// . + +// Make sure to test without _GLIBCXX_PARALLEL +#ifdef _GLIBCXX_PARALLEL +# undef _GLIBCXX_PARALLEL +#endif + +#include +#include +#include +#include + +void test() +{ + typedef unsigned short value_type; + typedef std::vector vector_type; + + const value_type c(0); + + vector_type v(10); + + std::accumulate(v.begin(), v.end(), value_type(1)); + std::accumulate(v.begin(), v.end(), value_type(1), std::plus()); + __gnu_parallel::accumulate(v.begin(), v.end(), value_type(1)); + __gnu_parallel::accumulate(v.begin(), v.end(), value_type(1), + std::plus()); + + std::inner_product(v.begin(), v.end(), v.begin(), value_type(1)); + std::inner_product(v.begin(), v.end(), v.begin(), value_type(1), + std::multiplies(), std::plus()); + __gnu_parallel::inner_product(v.begin(), v.end(), v.begin(), value_type(1)); + __gnu_parallel::inner_product(v.begin(), v.end(), v.begin(), value_type(1), + std::multiplies(), std::plus()); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc new file mode 100644 index 000000000..21a21c9ff --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc @@ -0,0 +1,64 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace std { + template + T accumulate(InputIterator first, InputIterator last, T init); + + template + T accumulate(InputIterator first, InputIterator last, T init, + BinaryOperation binary_op); + + template + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init); + + template + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init, + BinaryOperation1 binary_op1, + BinaryOperation2 binary_op2); + + template + OutputIterator partial_sum(InputIterator first, + InputIterator last, + OutputIterator result); + + template + OutputIterator partial_sum(InputIterator first, + InputIterator last, + OutputIterator result, + BinaryOperation binary_op); + + template + OutputIterator adjacent_difference(InputIterator first, + InputIterator last, + OutputIterator result); + + template + OutputIterator adjacent_difference(InputIterator first, + InputIterator last, + OutputIterator result, + BinaryOperation binary_op); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/random/std_c++0x_neg.cc b/libstdc++-v3/testsuite/26_numerics/headers/random/std_c++0x_neg.cc new file mode 100644 index 000000000..1f83cdac6 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/random/std_c++0x_neg.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=gnu++98" } + +// Copyright (C) 2007, 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 +// . + +#include + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/26_numerics/headers/random/types_std_c++0x.cc b/libstdc++-v3/testsuite/26_numerics/headers/random/types_std_c++0x.cc new file mode 100644 index 000000000..9f8ae967e --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/random/types_std_c++0x.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + using std::random_device; + using std::bernoulli_distribution; +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/valarray/synopsis.cc b/libstdc++-v3/testsuite/26_numerics/headers/valarray/synopsis.cc new file mode 100644 index 000000000..2f7b08468 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/valarray/synopsis.cc @@ -0,0 +1,127 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace std { + template class valarray; + + class slice; + template class slice_array; + + class gslice; + template class gslice_array; + template class mask_array; + template class indirect_array; + template valarray operator* + (const valarray&, const valarray&); + template valarray operator* (const valarray&, const T&); + template valarray operator* (const T&, const valarray&); + +template valarray operator/ + (const valarray&, const valarray&); +template valarray operator/ (const valarray&, const T&); +template valarray operator/ (const T&, const valarray&); +template valarray operator% + (const valarray&, const valarray&); +template valarray operator% (const valarray&, const T&); +template valarray operator% (const T&, const valarray&); +template valarray operator+ + (const valarray&, const valarray&); +template valarray operator+ (const valarray&, const T&); +template valarray operator+ (const T&, const valarray&); +template valarray operator- + (const valarray&, const valarray&); +template valarray operator- (const valarray&, const T&); +template valarray operator- (const T&, const valarray&); +template valarray operator^ + (const valarray&, const valarray&); +template valarray operator^ (const valarray&, const T&); +template valarray operator^ (const T&, const valarray&); +template valarray operator& + (const valarray&, const valarray&); +template valarray operator& (const valarray&, const T&); +template valarray operator& (const T&, const valarray&); +template valarray operator| + (const valarray&, const valarray&); +template valarray operator| (const valarray&, const T&); +template valarray operator| (const T&, const valarray&); +template valarray operator<< + (const valarray&, const valarray&); +template valarray operator<<(const valarray&, const T&); +template valarray operator<<(const T&, const valarray&); +template valarray operator>> + (const valarray&, const valarray&); +template valarray operator>>(const valarray&, const T&); +template valarray operator>>(const T&, const valarray&); +template valarray operator&& + (const valarray&, const valarray&); +template valarray operator&&(const valarray&, const T&); +template valarray operator&&(const T&, const valarray&); +template valarray operator|| + (const valarray&, const valarray&); +template valarray operator||(const valarray&, const T&); +template valarray operator||(const T&, const valarray&); + + template + valarray operator==(const valarray&, const valarray&); + template valarray operator==(const valarray&, const T&); + template valarray operator==(const T&, const valarray&); + template + valarray operator!=(const valarray&, const valarray&); + template valarray operator!=(const valarray&, const T&); + template valarray operator!=(const T&, const valarray&); + template + valarray operator< (const valarray&, const valarray&); + template valarray operator< (const valarray&, const T&); + template valarray operator< (const T&, const valarray&); + template + valarray operator> (const valarray&, const valarray&); + template valarray operator> (const valarray&, const T&); + template valarray operator> (const T&, const valarray&); + template + valarray operator<=(const valarray&, const valarray&); + template valarray operator<=(const valarray&, const T&); + template valarray operator<=(const T&, const valarray&); + template + valarray operator>=(const valarray&, const valarray&); + template valarray operator>=(const valarray&, const T&); + template valarray operator>=(const T&, const valarray&); + template valarray abs (const valarray&); + template valarray acos (const valarray&); + template valarray asin (const valarray&); + template valarray atan (const valarray&); + template valarray atan2 + (const valarray&, const valarray&); + template valarray atan2(const valarray&, const T&); + template valarray atan2(const T&, const valarray&); + template valarray cos (const valarray&); + template valarray cosh (const valarray&); + template valarray exp (const valarray&); + template valarray log (const valarray&); + template valarray log10(const valarray&); + template valarray pow(const valarray&, const valarray&); + template valarray pow(const valarray&, const T&); + template valarray pow(const T&, const valarray&); + template valarray sin (const valarray&); + template valarray sinh (const valarray&); + template valarray sqrt (const valarray&); + template valarray tan (const valarray&); + template valarray tanh (const valarray&); +} diff --git a/libstdc++-v3/testsuite/26_numerics/headers/valarray/types_std.cc b/libstdc++-v3/testsuite/26_numerics/headers/valarray/types_std.cc new file mode 100644 index 000000000..7c47f27f6 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/headers/valarray/types_std.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2007, 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 +// . + +#include + +namespace gnu +{ + typedef std::slice t1; + typedef std::gslice t2; +} -- cgit v1.2.3