9e5d14a285adea25f85a26f5ccaf6b792bc1699d
[platform/upstream/gcc48.git] / libstdc++-v3 / testsuite / 26_numerics / valarray / dr630-1.cc
1 // Copyright (C) 2009 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 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 #include <valarray>
19 #include <testsuite_hooks.h>
20
21 // DR 630.
22 void test01()
23 {
24   bool test __attribute__((unused)) = true;
25   using namespace std;
26
27   valarray<int> v1;
28   const valarray<int> v2(-1, 10000);
29
30   v1 = v2;
31   VERIFY( v1.size() == v2.size() );
32   VERIFY( (v1 == v2).min() == true );
33
34   valarray<int> v3(0, 10000);
35   const valarray<int> v4;
36
37   v3 = v4;
38   VERIFY( v3.size() == v4.size() );
39   VERIFY( v3.size() == 0 );
40
41   valarray<int> v5(0, 100);
42   const valarray<int> v6(-1, 10000);
43
44   v5 = v6;
45   VERIFY( v5.size() == v6.size() );
46   VERIFY( (v5 == v6).min() == true );
47
48   valarray<int> v7(0, 10000);
49   const valarray<int> v8(-1, 100);
50
51   v7 = v8;
52   VERIFY( v7.size() == v8.size() );
53   VERIFY( (v7 == v8).min() == true );
54 }
55
56 int main()
57 {
58   test01();
59   return 0;
60 }