1 // Copyright (C) 2002 Free Software Foundation, Inc.
2 //
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 2, or (at your option)
7 // any later version.
8
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING. If not, write to the Free
16 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 // USA.
18
19 // backward strstream members
20
21 #include <strstream>
22 #include <testsuite_hooks.h>
23
24 // { dg-options "-Wno-deprecated" }
25
test01()26 int test01()
27 {
28 std::strstream s;
29 for (unsigned i=0 ; i!= 1000 ; ++i)
30 s << i << std::endl;
31 s << std::ends;
32 return 0;
33 }
34
35
test02()36 int test02()
37 {
38 std::ostrstream buf;
39 buf << std::ends;
40 char *s = buf.str ();
41 delete [] s;
42 }
43
main()44 int main()
45 {
46 test01();
47 test02();
48 return 0;
49 }
50