]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/1.cc
re PR testsuite/39696 (gcc.dg/tree-ssa/ssa-ccp-25.c scan-tree-dump doesn't work on...
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_ostream / inserters_character / wchar_t / 1.cc
CommitLineData
ba4b172f
PC
1// Copyright (C) 2005 Free Software Foundation
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
83f51799 16// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
ba4b172f
PC
17// USA.
18
19// 27.6.2.5.4 basic_ostream character inserters
20
21#include <string>
22#include <ostream>
23#include <fstream>
24#include <testsuite_hooks.h>
25
26// ofstream
27void test01()
28{
29 std::wstring str01;
30 const int size = 1000;
31 const char name_02[] = "wostream_inserter_char-1.txt";
32
33 // initialize string
34 for(int i=0 ; i < size; i++) {
35 str01 += L'1';
36 str01 += L'2';
37 str01 += L'3';
38 str01 += L'4';
39 str01 += L'5';
40 str01 += L'6';
41 str01 += L'7';
42 str01 += L'8';
43 str01 += L'9';
44 str01 += L'\n';
45 }
46 std::wofstream f(name_02);
47
48 f << str01;
49 f.close();
50}
51
52int main()
53{
54 test01();
55 return 0;
56}