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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [decimal/] [ctor.cc] - Blame information for rev 848

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

Line No. Rev Author Line
1 742 jeremybenn
// Copyright (C) 2009 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-require-effective-target dfp }
19
 
20
// ISO/IEC TR 24733  3.2.2.1  Construct/copy/destroy (decimal32).
21
// ISO/IEC TR 24733  3.2.3.1  Construct/copy/destroy (decimal64).
22
// ISO/IEC TR 24733  3.2.4.1  Construct/copy/destroy (decimal128).
23
 
24
// Test the default constructor.
25
 
26
#include <decimal/decimal>
27
#include <cstring>
28
#include <testsuite_hooks.h>
29
 
30
using namespace std::decimal;
31
 
32
void
33
ctor_32 (void)
34
{
35
  decimal32 a;
36
  float b __attribute__((mode(SD))) = 0.e-101DF;
37
 
38
  VERIFY (memcmp (&a, &b, 4) == 0);
39
}
40
 
41
void
42
ctor_64 (void)
43
{
44
  decimal64 a;
45
  float b __attribute__((mode(DD))) = 0.e-398DD;
46
 
47
  VERIFY (memcmp (&a, &b, 8) == 0);
48
}
49
 
50
void
51
ctor_128 (void)
52
{
53
  decimal128 a;
54
  float b __attribute__((mode(TD))) = 0.e-6176DL;
55
 
56
  VERIFY (memcmp (&a, &b, 16) == 0);
57
}
58
 
59
int
60
main ()
61
{
62
  ctor_32 ();
63
  ctor_64 ();
64
  ctor_128 ();
65
}

powered by: WebSVN 2.1.0

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