1178476Sjb// 2006-08-22  Paolo Carlini  <pcarlini@suse.de>
2178476Sjb//
3178476Sjb// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
4178476Sjb//
5178476Sjb// This file is part of the GNU ISO C++ Library.  This library is free
6178476Sjb// software; you can redistribute it and/or modify it under the
7178476Sjb// terms of the GNU General Public License as published by the
8178476Sjb// Free Software Foundation; either version 3, or (at your option)
9178476Sjb// any later version.
10178476Sjb//
11178476Sjb// This library is distributed in the hope that it will be useful,
12178476Sjb// but WITHOUT ANY WARRANTY; without even the implied warranty of
13178476Sjb// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14178476Sjb// GNU General Public License for more details.
15178476Sjb//
16178476Sjb// You should have received a copy of the GNU General Public License along
17178476Sjb// with this library; see the file COPYING3.  If not see
18178476Sjb// <http://www.gnu.org/licenses/>.
19178476Sjb
20178476Sjb// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1]
21178476Sjb// 5.1.1 Table 16
22178476Sjb
23178476Sjb#include <sstream>
24178476Sjb#include <tr1/random>
25178476Sjb#include <testsuite_hooks.h>
26178476Sjb
27178476Sjbvoid
28178476Sjbtest01()
29178476Sjb{
30178476Sjb  bool test __attribute__((unused)) = true;
31178476Sjb  using std::tr1::subtract_with_carry_01;
32178476Sjb
33178476Sjb  std::stringstream str;
34178476Sjb  subtract_with_carry_01<float, 24, 10, 24> u;
35178476Sjb  subtract_with_carry_01<float, 24, 10, 24> v;
36178476Sjb
37178476Sjb  u(); // advance
38178476Sjb  str << u;
39178476Sjb
40178476Sjb  VERIFY( u != v );
41178476Sjb
42178476Sjb  str >> v;
43178476Sjb  VERIFY( u == v );
44178476Sjb}
45178476Sjb
46178476Sjbint main()
47178476Sjb{
48178476Sjb  test01();
49178476Sjb  return 0;
50178476Sjb}
51178476Sjb