OSDN Git Service

Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 23_containers / bitset / all / 1.cc
1 // 2007-11-23  Paolo Carlini  <pcarlini@suse.de>
2
3 // Copyright (C) 2007, 2009 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library.  This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3.  If not see
18 // <http://www.gnu.org/licenses/>.
19
20 // 23.3.5.2 bitset members
21
22 #include <bitset>
23 #include <testsuite_hooks.h>
24
25 // DR 693. std::bitset::all() missing.
26 void test01()
27 {
28   bool test __attribute__((unused)) = true;
29
30   std::bitset<0> z1;
31   VERIFY( z1.all() );
32   z1.set();
33   VERIFY( z1.all() );
34
35   std::bitset<8> z2;
36   VERIFY( !z2.all() );
37   z2.set();
38   VERIFY( z2.all() );
39
40   std::bitset<16> z3;
41   VERIFY( !z3.all() );
42   z3.set();
43   VERIFY( z3.all() );
44
45   std::bitset<32> z4;
46   VERIFY( !z4.all() );
47   z4.set();
48   VERIFY( z4.all() );
49
50   std::bitset<64> z5;
51   VERIFY( !z5.all() );
52   z5.set();
53   VERIFY( z5.all() );
54
55   std::bitset<96> z6;
56   VERIFY( !z6.all() );
57   z6.set();
58   VERIFY( z6.all() );
59
60   std::bitset<128> z7;
61   VERIFY( !z7.all() );
62   z7.set();
63   VERIFY( z7.all() );
64
65   std::bitset<192> z8;
66   VERIFY( !z8.all() );
67   z8.set();
68   VERIFY( z8.all() );
69
70   std::bitset<1024> z9;
71   VERIFY( !z9.all() );
72   z9.set();
73   VERIFY( z9.all() );
74 }
75
76 int main()
77 {
78   test01();
79   return 0;
80 }