diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/18_support/headers | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'libstdc++-v3/testsuite/18_support/headers')
27 files changed, 903 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/18_support/headers/cfloat/values.cc b/libstdc++-v3/testsuite/18_support/headers/cfloat/values.cc new file mode 100644 index 000000000..2019afea8 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cfloat/values.cc @@ -0,0 +1,53 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <cfloat> + +namespace gnu +{ + double d1 = DBL_DIG; + double d2 = DBL_EPSILON; + double d3 = DBL_MANT_DIG; + double d4 = DBL_MAX; + double d5 = DBL_MAX_10_EXP; + double d6 = DBL_MAX_EXP; + double d7 = DBL_MIN; + double d8 = DBL_MIN_10_EXP; + double d9 = DBL_MIN_EXP; + + float f1 = FLT_DIG; + float f2 = FLT_EPSILON; + float f3 = FLT_MANT_DIG; + float f4 = FLT_MAX; + float f5 = FLT_MAX_10_EXP; + float f6 = FLT_MAX_EXP; + float f7 = FLT_MIN; + float f8 = FLT_MIN_10_EXP; + float f9 = FLT_MIN_EXP; + + long double ld1 = LDBL_DIG; + long double ld2 = LDBL_EPSILON; + long double ld3 = LDBL_MANT_DIG; + long double ld4 = LDBL_MAX; + long double ld5 = LDBL_MAX_10_EXP; + long double ld6 = LDBL_MAX_EXP; + long double ld7 = LDBL_MIN; + long double ld8 = LDBL_MIN_10_EXP; + long double ld9 = LDBL_MIN_EXP; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/climits/values.cc b/libstdc++-v3/testsuite/18_support/headers/climits/values.cc new file mode 100644 index 000000000..5b0c5688d --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/climits/values.cc @@ -0,0 +1,52 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <climits> + +namespace gnu +{ + // char + char c1 = CHAR_BIT; + char c2 = CHAR_MAX; + char c3 = CHAR_MIN; + + // int + int i2 = INT_MAX; + int i3 = INT_MIN; + + // short + short s2 = SHRT_MAX; + short s3 = SHRT_MIN; + + // long + long l2 = LONG_MAX; + long l3 = LONG_MIN; + + unsigned long mb = MB_LEN_MAX; + + // signed char + signed char sc1 = SCHAR_MIN; + signed char sc2 = SCHAR_MAX; + + // unsigned + unsigned int ui = UINT_MAX; + unsigned short us = USHRT_MAX; + unsigned long ul = ULONG_MAX; + +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csetjmp/functions_std.cc b/libstdc++-v3/testsuite/18_support/headers/csetjmp/functions_std.cc new file mode 100644 index 000000000..8f2e0d650 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csetjmp/functions_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <csetjmp> + +namespace gnu +{ + using std::longjmp; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csetjmp/macros.cc b/libstdc++-v3/testsuite/18_support/headers/csetjmp/macros.cc new file mode 100644 index 000000000..0c9c9f02e --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csetjmp/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 +// <http://www.gnu.org/licenses/>. + +#include <csetjmp> + +namespace gnu +{ +#ifndef setjmp + #error "setjmp_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csetjmp/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/csetjmp/types_std.cc new file mode 100644 index 000000000..abf8cc589 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csetjmp/types_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <csetjmp> + +namespace gnu +{ + std::jmp_buf j; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csignal/functions_std.cc b/libstdc++-v3/testsuite/18_support/headers/csignal/functions_std.cc new file mode 100644 index 000000000..ea96bfbd9 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csignal/functions_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 +// <http://www.gnu.org/licenses/>. + +#include <csignal> + +namespace gnu +{ + using std::raise; + using std::signal; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csignal/macros.cc b/libstdc++-v3/testsuite/18_support/headers/csignal/macros.cc new file mode 100644 index 000000000..33f8d023b --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csignal/macros.cc @@ -0,0 +1,55 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <csignal> + +namespace gnu +{ +#ifndef SIGABRT + #error "SIGABRT_must_be_a_macro" +#endif + +#ifndef SIGILL + #error "SIGILL_must_be_a_macro" +#endif + +#ifndef SIGSEGV + #error "SIGSEGV_must_be_a_macro" +#endif + +#ifndef SIG_DFL + #error "SIG_DFL_must_be_a_macro" +#endif + +#ifndef SIGFPE + #error "SIGFPE_must_be_a_macro" +#endif + +#ifndef SIGINT + #error "SIGINT_must_be_a_macro" +#endif + +#ifndef SIGTERM + #error "SIGTERM_must_be_a_macro" +#endif + +#ifndef SIG_ERR + #error "SIG_ERR_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/18_support/headers/csignal/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/csignal/types_std.cc new file mode 100644 index 000000000..5745048fd --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/csignal/types_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <csignal> + +namespace gnu +{ + std::sig_atomic_t s; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdarg/macros.cc b/libstdc++-v3/testsuite/18_support/headers/cstdarg/macros.cc new file mode 100644 index 000000000..b89716e32 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdarg/macros.cc @@ -0,0 +1,35 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <cstdarg> + +namespace gnu +{ +#ifndef va_arg + #error "va_arg_must_be_a_macro" +#endif + +#ifndef va_start + #error "va_start_must_be_a_macro" +#endif + +#ifndef va_end + #error "va_end_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdarg/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/cstdarg/types_std.cc new file mode 100644 index 000000000..e4314627c --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdarg/types_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <cstdarg> + +namespace gnu +{ + std::va_list v; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdbool/std_c++0x_neg.cc b/libstdc++-v3/testsuite/18_support/headers/cstdbool/std_c++0x_neg.cc new file mode 100644 index 000000000..146b9656f --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdbool/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 +// <http://www.gnu.org/licenses/>. + +#include <cstdbool> + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/18_support/headers/cstddef/macros.cc b/libstdc++-v3/testsuite/18_support/headers/cstddef/macros.cc new file mode 100644 index 000000000..c17e86f5e --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstddef/macros.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-Wno-conversion-null" } +// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 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 +// <http://www.gnu.org/licenses/>. + +#include <cstddef> + +namespace gnu +{ + struct test_type + { + int i; + int j; + }; + + // offsetof + void test01() + { + std::size_t i __attribute__((unused)) = offsetof(struct test_type, i); +#ifndef offsetof + #error "offsetof_must_be_a_macro" +#endif + } + + // NULL + void test02() + { + // Must not be (void*)0 + const int j __attribute__((unused)) = NULL; + +#ifndef NULL + #error "NULL_must_be_a_macro" +#endif + } +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstddef/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/cstddef/types_std.cc new file mode 100644 index 000000000..82c438919 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstddef/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 +// <http://www.gnu.org/licenses/>. + +#include <cstddef> + +namespace gnu +{ + std::size_t s; + std::ptrdiff_t p; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdint/std_c++0x_neg.cc b/libstdc++-v3/testsuite/18_support/headers/cstdint/std_c++0x_neg.cc new file mode 100644 index 000000000..afd65a36a --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdint/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 +// <http://www.gnu.org/licenses/>. + +#include <cstdint> + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc b/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc new file mode 100644 index 000000000..1210ba611 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc @@ -0,0 +1,54 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2007, 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 +// <http://www.gnu.org/licenses/>. + +#include <cstdint> + +void test01() +{ + typedef std::int8_t my_int8_t; + typedef std::int16_t my_int16_t; + typedef std::int32_t my_int32_t; + typedef std::int64_t my_int64_t; + typedef std::int_fast8_t my_int_fast8_t; + typedef std::int_fast16_t my_int_fast16_t; + typedef std::int_fast32_t my_int_fast32_t; + typedef std::int_fast64_t my_int_fast64_t; + typedef std::int_least8_t my_int_least8_t; + typedef std::int_least16_t my_int_least16_t; + typedef std::int_least32_t my_int_least32_t; + typedef std::int_least64_t my_int_least64_t; + typedef std::intmax_t my_intmax_t; + typedef std::intptr_t my_intptr_t; + typedef std::uint8_t my_uint8_t; + typedef std::uint16_t my_uint16_t; + typedef std::uint32_t my_uint32_t; + typedef std::uint64_t my_uint64_t; + typedef std::uint_fast8_t my_uint_fast8_t; + typedef std::uint_fast16_t my_uint_fast16_t; + typedef std::uint_fast32_t my_uint_fast32_t; + typedef std::uint_fast64_t my_uint_fast64_t; + typedef std::uint_least8_t my_uint_least8_t; + typedef std::uint_least16_t my_uint_least16_t; + typedef std::uint_least32_t my_uint_least32_t; + typedef std::uint_least64_t my_uint_least64_t; + typedef std::uintmax_t my_uintmax_t; + typedef std::uintptr_t my_uintptr_t; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdlib/functions_std.cc b/libstdc++-v3/testsuite/18_support/headers/cstdlib/functions_std.cc new file mode 100644 index 000000000..0f98e7296 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/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 +// <http://www.gnu.org/licenses/>. + +#include <cstdlib> + +namespace gnu +{ + using std::abort; + using std::atexit; + using std::exit; + + using std::getenv; + using std::system; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdlib/macros.cc b/libstdc++-v3/testsuite/18_support/headers/cstdlib/macros.cc new file mode 100644 index 000000000..f6aee4d03 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/cstdlib/macros.cc @@ -0,0 +1,32 @@ +// { dg-do compile } +// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2001, 2003, 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 +// <http://www.gnu.org/licenses/>. + +#include <cstdlib> + +namespace gnu +{ +#ifndef EXIT_FAILURE + #error "EXIT_FAILURE_must_be_a_macro" +#endif + +#ifndef EXIT_SUCCESS + #error "EXIT_SUCCESS_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/18_support/headers/ctime/functions_std.cc b/libstdc++-v3/testsuite/18_support/headers/ctime/functions_std.cc new file mode 100644 index 000000000..9f64b7f5f --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/ctime/functions_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <ctime> + +namespace gnu +{ + using std::clock; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/ctime/macros.cc b/libstdc++-v3/testsuite/18_support/headers/ctime/macros.cc new file mode 100644 index 000000000..e191b43e5 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/ctime/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 +// <http://www.gnu.org/licenses/>. + +#include <ctime> + +namespace gnu +{ +#ifndef CLOCKS_PER_SEC + #error "CLOCKS_PER_SEC_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/18_support/headers/ctime/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/ctime/types_std.cc new file mode 100644 index 000000000..5f6c7b28d --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/ctime/types_std.cc @@ -0,0 +1,25 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <ctime> + +namespace gnu +{ + std::clock_t c; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc new file mode 100644 index 000000000..6c64eb29d --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc @@ -0,0 +1,35 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <exception> + +namespace std { + class exception; + class bad_exception; + + typedef void (*unexpected_handler)(); + unexpected_handler set_unexpected(unexpected_handler f ) throw(); + void unexpected(); + + typedef void (*terminate_handler)(); + terminate_handler set_terminate(terminate_handler f ) throw(); + void terminate() throw(); + + bool uncaught_exception() throw(); +} diff --git a/libstdc++-v3/testsuite/18_support/headers/exception/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/exception/types_std.cc new file mode 100644 index 000000000..142b83583 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/exception/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 +// <http://www.gnu.org/licenses/>. + +#include <exception> + +namespace gnu +{ + typedef std::exception t1; + typedef std::bad_exception t2; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/limits/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/limits/synopsis.cc new file mode 100644 index 000000000..975b4ec38 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/limits/synopsis.cc @@ -0,0 +1,47 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <limits> + +namespace std { + template<class T> class numeric_limits; + +#if 0 + enum float_round_style; + enum float_denorm_style; +#endif + + template<> class numeric_limits<bool>; + + template<> class numeric_limits<char>; + template<> class numeric_limits<signed char>; + template<> class numeric_limits<unsigned char>; + template<> class numeric_limits<wchar_t>; + + template<> class numeric_limits<short>; + template<> class numeric_limits<int>; + template<> class numeric_limits<long>; + template<> class numeric_limits<unsigned short>; + template<> class numeric_limits<unsigned int>; + template<> class numeric_limits<unsigned long>; + + template<> class numeric_limits<float>; + template<> class numeric_limits<double>; + template<> class numeric_limits<long double>; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc new file mode 100644 index 000000000..f21dd1dc6 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/new/synopsis.cc @@ -0,0 +1,42 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <new> + +namespace std { + class bad_alloc; + struct nothrow_t; + extern const nothrow_t nothrow; + typedef void (*new_handler)(); + new_handler set_new_handler(new_handler new_p) throw(); +} + +void* operator new(std::size_t size) throw(std::bad_alloc); +void* operator new(std::size_t size, const std::nothrow_t&) throw(); +void operator delete(void* ptr) throw(); +void operator delete(void* ptr, const std::nothrow_t&) throw(); +void* operator new[](std::size_t size) throw(std::bad_alloc); +void* operator new[](std::size_t size, const std::nothrow_t&) throw(); +void operator delete[](void* ptr) throw(); +void operator delete[](void* ptr, const std::nothrow_t&) throw(); + +void* operator new (std::size_t size, void* ptr) throw(); +void* operator new[](std::size_t size, void* ptr) throw(); +void operator delete (void* ptr, void*) throw(); +void operator delete[](void* ptr, void*) throw(); diff --git a/libstdc++-v3/testsuite/18_support/headers/new/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/new/types_std.cc new file mode 100644 index 000000000..b78a0becd --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/new/types_std.cc @@ -0,0 +1,28 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <new> + +namespace gnu +{ + typedef std::bad_alloc t1; + typedef std::nothrow_t t2; + + typedef std::new_handler t3; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/typeinfo/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/typeinfo/synopsis.cc new file mode 100644 index 000000000..973a60823 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/typeinfo/synopsis.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 +// <http://www.gnu.org/licenses/>. + +#include <typeinfo> + +namespace std { + class type_info; + class bad_cast; + class bad_typeid; +} diff --git a/libstdc++-v3/testsuite/18_support/headers/typeinfo/types_std.cc b/libstdc++-v3/testsuite/18_support/headers/typeinfo/types_std.cc new file mode 100644 index 000000000..58ef5c3a3 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/typeinfo/types_std.cc @@ -0,0 +1,28 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <typeinfo> + +namespace gnu +{ + typedef std::type_info t1; + typedef std::bad_cast t2; + + typedef std::bad_typeid t3; +} |