OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [26_numerics/] [valarray/] [dr630-2.cc] - Blame information for rev 833

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// { dg-options "-std=gnu++0x" }
2
 
3
// Copyright (C) 2009 Free Software Foundation
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
#include <valarray>
21
#include <testsuite_hooks.h>
22
 
23
// DR 630.
24
void test01()
25
{
26
  bool test __attribute__((unused)) = true;
27
  using namespace std;
28
 
29
  valarray<int> v1;
30
 
31
  v1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
32
  VERIFY( v1.size() == 10 );
33
  VERIFY( v1.min() == -1 );
34
  VERIFY( v1.max() == -1 );
35
 
36
  valarray<int> v2(0, 10);
37
 
38
  v2 = { };
39
  VERIFY( v2.size() == 0 );
40
 
41
  valarray<int> v3(0, 10);
42
 
43
  v3 = { -1, -1, -1, -1, -1 };
44
  VERIFY( v3.size() == 5 );
45
  VERIFY( v3.min() == -1 );
46
  VERIFY( v3.max() == -1 );
47
 
48
  valarray<int> v4(0, 5);
49
 
50
  v4 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
51
  VERIFY( v4.size() == 10 );
52
  VERIFY( v4.min() == -1 );
53
  VERIFY( v4.max() == -1 );
54
 
55
  valarray<int> v5(0, 10);
56
 
57
  v5 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
58
  VERIFY( v5.size() == 10 );
59
  VERIFY( v5.min() == -1 );
60
  VERIFY( v5.max() == -1 );
61
}
62
 
63
int main()
64
{
65
  test01();
66
  return 0;
67
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.