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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [convert-dfp-fold.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99 -O" } */
2
 
3
/* N1150 5.2 Conversions among decimal floating types and between
4
   decimal floating types and generic floating types.
5
   C99 6.3.1.5(3) New.  */
6
 
7
extern void link_error ();
8
 
9
int
10
main ()
11
{
12
  _Decimal32 d32;
13
  _Decimal64 d64;
14
  _Decimal128 d128;
15
 
16
  /* Conversions to larger types.  */
17
  d32 = 123.4df;
18
  d64 = d32;
19
  if (d64 != 123.4dd)
20
    link_error ();
21
  d128 = d32;
22
  if (d128 != 123.4dl)
23
    link_error ();
24
  d64 = 345.678dd;
25
  d128 = d64;
26
  if (d128 != 345.678dl)
27
    link_error ();
28
 
29
  /* Conversions to smaller types for which the value fits.  */
30
  d64 = 3456.789dd;
31
  d32 = d64;
32
  if (d32 != 3456.789df)
33
    link_error ();
34
  d128 = 123.4567dl;
35
  d32 = d128;
36
  if (d32 != 123.4567dl)
37
    link_error ();
38
 
39
  d128 = 1234567890.123456dl;
40
  d64 = d128;
41
  if (d64 != 1234567890.123456dd)
42
    link_error ();
43
 
44
  return 0;
45
}

powered by: WebSVN 2.1.0

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