diff options
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/headers')
20 files changed, 752 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/headers/cinttypes/std_c++0x_neg.cc b/libstdc++-v3/testsuite/27_io/headers/cinttypes/std_c++0x_neg.cc new file mode 100644 index 000000000..21da0770b --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/cinttypes/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 <cinttypes> + +// { dg-error "upcoming ISO" "" { target *-*-* } 32 } + + + diff --git a/libstdc++-v3/testsuite/27_io/headers/cinttypes/types_std_c++0x.cc b/libstdc++-v3/testsuite/27_io/headers/cinttypes/types_std_c++0x.cc new file mode 100644 index 000000000..f2958a090 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/cinttypes/types_std_c++0x.cc @@ -0,0 +1,30 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +#include <cinttypes> + +void test01() +{ +#if _GLIBCXX_USE_C99_INTTYPES_TR1 + + typedef std::imaxdiv_t my_imaxdiv_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc new file mode 100644 index 000000000..4a0468618 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc @@ -0,0 +1,65 @@ +// { 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 <cstdio> + +namespace gnu +{ + using std::clearerr; + using std::tmpfile; + using std::fgets; + using std::fscanf; + using std::gets; + using std::rename; + using std::fclose; + using std::fopen; + using std::fseek; + using std::perror; + using std::rewind; + using std::tmpnam; + using std::feof; + using std::fprintf; + using std::fsetpos; + using std::printf; + using std::scanf; + using std::ungetc; + using std::ferror; + using std::vfprintf; + using std::fputc; + using std::ftell; + using std::putc; + using std::setbuf; + using std::fflush; + using std::vprintf; + using std::fputs; + using std::fwrite; + using std::putchar; + using std::setvbuf; + using std::fgetc; + using std::vsprintf; + using std::fread; + using std::getc; + using std::puts; + using std::sprintf; + using std::fgetpos; + using std::freopen; + using std::getchar; + using std::remove; + using std::sscanf; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/macros.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/macros.cc new file mode 100644 index 000000000..8a036b48d --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/macros.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 +// <http://www.gnu.org/licenses/>. + +#include <cstdio> + +namespace gnu +{ +#ifndef NULL + #error "NULL_must_be_a_macro" +#endif + +#ifndef BUFSIZ + #error "BUFSIZ_must_be_a_macro" +#endif + +#ifndef EOF + #error "EOF_must_be_a_macro" +#endif + +#ifndef FILENAME_MAX + #error "FILENAME_MAX_must_be_a_macro" +#endif + +#ifndef L_tmpnam + #error "L_tmpnam_must_be_a_macro" +#endif + +#ifndef FOPEN_MAX + #error "FOPEN_MAX_must_be_a_macro" +#endif + +#ifndef SEEK_CUR + #error "SEEK_CUR_must_be_a_macro" +#endif + +#ifndef SEEK_END + #error "SEEK_END_must_be_a_macro" +#endif + +#ifndef SEEK_SET + #error "SEEK_SET_must_be_a_macro" +#endif + +#ifndef TMP_MAX + #error "TMP_MAX_must_be_a_macro" +#endif + +#ifndef _IOFBF + #error "_IOFBF_must_be_a_macro" +#endif + +#ifndef _IOLBF + #error "_IOLBF_must_be_a_macro" +#endif + +#ifndef _IONBF + #error "_IONBF_must_be_a_macro" +#endif + +#ifndef stderr + #error "stderr_must_be_a_macro" +#endif + +#ifndef stdin + #error "stdin_must_be_a_macro" +#endif + +#ifndef stdout + #error "stdout_must_be_a_macro" +#endif +} diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc new file mode 100644 index 000000000..f3c15d1f1 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.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 <cstdio> + +namespace gnu +{ + std::size_t s; + std::FILE f; + std::FILE fpos_t; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/fstream/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/fstream/synopsis.cc new file mode 100644 index 000000000..f65c4d793 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/fstream/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 <fstream> + +namespace std { + template <class charT, class traits> + class basic_filebuf; + typedef basic_filebuf<char> filebuf; + typedef basic_filebuf<wchar_t> wfilebuf; + + template <class charT, class traits> + class basic_ifstream; + typedef basic_ifstream<char> ifstream; + typedef basic_ifstream<wchar_t> wifstream; + + template <class charT, class traits> + class basic_ofstream; + typedef basic_ofstream<char> ofstream; + typedef basic_ofstream<wchar_t> wofstream; + + template <class charT, class traits> + class basic_fstream; + typedef basic_fstream<char> fstream; + typedef basic_fstream<wchar_t> wfstream; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/fstream/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/fstream/types_std.cc new file mode 100644 index 000000000..2a66f5ff5 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/fstream/types_std.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <fstream> + +namespace gnu +{ + typedef std::filebuf t1; + typedef std::wfilebuf t2; + + typedef std::ifstream t3; + typedef std::wifstream t4; + + typedef std::ofstream t5; + typedef std::wofstream t6; + + typedef std::fstream t7; + typedef std::wfstream t8; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/iomanip/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/iomanip/synopsis.cc new file mode 100644 index 000000000..9071beaf1 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/iomanip/synopsis.cc @@ -0,0 +1,32 @@ +// { 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 <iomanip> + +namespace std { +#if 0 + // Types T1, T2, ... are unspecified implementation types + T1 resetiosflags(ios_base::fmtflags mask); + T2 setiosflags (ios_base::fmtflags mask); + T3 setbase(int base); + template<charT> T4 setfill(charT c); + T5 setprecision(int n); + T6 setw(int n); +#endif +} diff --git a/libstdc++-v3/testsuite/27_io/headers/ios/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/ios/synopsis.cc new file mode 100644 index 000000000..577aa677f --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/ios/synopsis.cc @@ -0,0 +1,59 @@ +// { 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 <ios> + +namespace std { +#if 0 + typedef OFF_T streamoff; + typedef SZ_T streamsize; +#endif + + template <class stateT> class fpos; + class ios_base; + template <class charT, class traits> + class basic_ios; + + // 27.4.5, manipulators: + ios_base& boolalpha (ios_base& str); + ios_base& noboolalpha(ios_base& str); + ios_base& showbase (ios_base& str); + ios_base& noshowbase (ios_base& str); + ios_base& showpoint (ios_base& str); + ios_base& noshowpoint(ios_base& str); + ios_base& showpos (ios_base& str); + ios_base& noshowpos (ios_base& str); + ios_base& skipws (ios_base& str); + ios_base& noskipws (ios_base& str); + ios_base& uppercase (ios_base& str); + ios_base& nouppercase(ios_base& str); + ios_base& unitbuf (ios_base& str); + ios_base& nounitbuf (ios_base& str); + // 27.4.5.2 adjustfield: + ios_base& internal (ios_base& str); + ios_base& left (ios_base& str); + ios_base& right (ios_base& str); + // 27.4.5.3 basefield: + ios_base& dec (ios_base& str); + ios_base& hex (ios_base& str); + ios_base& oct (ios_base& str); + // 27.4.5.4 floatfield: + ios_base& fixed (ios_base& str); + ios_base& scientific (ios_base& str); +} diff --git a/libstdc++-v3/testsuite/27_io/headers/ios/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/ios/types_std.cc new file mode 100644 index 000000000..000c2046e --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/ios/types_std.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 <ios> + +namespace gnu +{ + typedef std::streamoff t1; + typedef std::streamsize t2; + typedef std::ios_base t3; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/iostream/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/iostream/synopsis.cc new file mode 100644 index 000000000..10fc7072b --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/iostream/synopsis.cc @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <iostream> + +namespace std { + extern istream cin; + extern ostream cout; + extern ostream cerr; + extern ostream clog; + extern wistream wcin; + extern wostream wcout; + extern wostream wcerr; + extern wostream wclog; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/iostream/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/iostream/types_std.cc new file mode 100644 index 000000000..54b4eab83 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/iostream/types_std.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <iostream> + +namespace gnu +{ + using std::cout; + using std::cerr; + using std::cin; + using std::clog; + + using std::wcout; + using std::wcerr; + using std::wcin; + using std::wclog; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/istream/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/istream/synopsis.cc new file mode 100644 index 000000000..a76135a69 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/istream/synopsis.cc @@ -0,0 +1,33 @@ +// { 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 <istream> + +namespace std { + template <class charT, class traits > + class basic_istream; + typedef basic_istream<char> istream; + typedef basic_istream<wchar_t> wistream; + template <class charT, class traits > + class basic_iostream; + typedef basic_iostream<char> iostream; + typedef basic_iostream<wchar_t> wiostream; + template <class charT, class traits> + basic_istream<charT,traits>& ws(basic_istream<charT,traits>& is); +} diff --git a/libstdc++-v3/testsuite/27_io/headers/istream/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/istream/types_std.cc new file mode 100644 index 000000000..71df8a492 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/istream/types_std.cc @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <istream> + +namespace gnu +{ + typedef std::istream t1; + typedef std::wistream t2; + + typedef std::iostream t3; + typedef std::wiostream t4; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/ostream/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/ostream/synopsis.cc new file mode 100644 index 000000000..405feaa30 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/ostream/synopsis.cc @@ -0,0 +1,33 @@ +// { 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 <ostream> + +namespace std { + template <class charT, class traits> + class basic_ostream; + typedef basic_ostream<char> ostream; + typedef basic_ostream<wchar_t> wostream; + template <class charT, class traits> + basic_ostream<charT,traits>& endl(basic_ostream<charT,traits>& os); + template <class charT, class traits> + basic_ostream<charT,traits>& ends(basic_ostream<charT,traits>& os); + template <class charT, class traits> + basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os); +} diff --git a/libstdc++-v3/testsuite/27_io/headers/ostream/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/ostream/types_std.cc new file mode 100644 index 000000000..31358bab1 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/ostream/types_std.cc @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <ostream> + +namespace gnu +{ + typedef std::ostream t1; + typedef std::wostream t2; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/sstream/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/sstream/synopsis.cc new file mode 100644 index 000000000..cb8437cfc --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/sstream/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 <sstream> + +namespace std { + template <class charT, class traits, class Allocator> + class basic_stringbuf; + typedef basic_stringbuf<char> stringbuf; + typedef basic_stringbuf<wchar_t> wstringbuf; + + template <class charT, class traits, class Allocator> + class basic_istringstream; + typedef basic_istringstream<char> istringstream; + typedef basic_istringstream<wchar_t> wistringstream; + + template <class charT, class traits, class Allocator> + class basic_ostringstream; + typedef basic_ostringstream<char> ostringstream; + typedef basic_ostringstream<wchar_t> wostringstream; + + template <class charT, class traits, class Allocator> + class basic_stringstream; + typedef basic_stringstream<char> stringstream; + typedef basic_stringstream<wchar_t> wstringstream; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/sstream/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/sstream/types_std.cc new file mode 100644 index 000000000..6e46a2203 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/sstream/types_std.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <sstream> + +namespace gnu +{ + typedef std::stringbuf t1; + typedef std::wstringbuf t2; + + typedef std::istringstream t3; + typedef std::wistringstream t4; + + typedef std::ostringstream t5; + typedef std::wostringstream t6; + + typedef std::stringstream t7; + typedef std::wstringstream t8; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/streambuf/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/streambuf/synopsis.cc new file mode 100644 index 000000000..d0a38ef78 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/streambuf/synopsis.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 <streambuf> + +namespace std { + template <class charT, class traits> + class basic_streambuf; + typedef basic_streambuf<char> streambuf; + typedef basic_streambuf<wchar_t> wstreambuf; +} diff --git a/libstdc++-v3/testsuite/27_io/headers/streambuf/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/streambuf/types_std.cc new file mode 100644 index 000000000..2ad2fb82c --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/headers/streambuf/types_std.cc @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 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 <streambuf> + +namespace gnu +{ + typedef std::streambuf t1; + typedef std::wstreambuf t2; +} |