| 1 |
// Copyright (C) 2020-2025 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 3, 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 COPYING3. If not see |
| 16 |
// <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
// { dg-do run { target c++11 xfail *-*-* } } |
| 19 |
// { dg-require-fileio "" } |
| 20 |
// { dg-require-debug-mode "" } |
| 21 |
|
| 22 |
#include <iterator> |
| 23 |
#include <fstream> |
| 24 |
#include <algorithm> |
| 25 |
#include <deque> |
| 26 |
|
| 27 |
void test01() |
| 28 |
{ |
| 29 |
using namespace std; |
| 30 |
|
| 31 |
typedef istreambuf_iterator<char> in_iterator_type; |
| 32 |
|
| 33 |
ifstream fbuf_ref("istream_unformatted-1.txt"), |
| 34 |
fbuf("istream_unformatted-1.txt"); |
| 35 |
|
| 36 |
char buffer_ref[16500]; |
| 37 |
deque<char> dq(17000, 'a'); |
| 38 |
|
| 39 |
fbuf_ref.read(buffer_ref, 16500); |
| 40 |
|
| 41 |
in_iterator_type beg(fbuf); |
| 42 |
copy_n(beg, 17000, dq.begin()); |
| 43 |
} |
| 44 |
|
| 45 |
int |
| 46 |
main() |
| 47 |
{ |
| 48 |
test01(); |
| 49 |
return 0; |
| 50 |
} |