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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [operator-comma.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99 -O0" } */
2
 
3
/* C99 6.5.17: Comma operator.
4
   Test with decimal float operands.  */
5
 
6
extern void abort (void);
7
static int failcnt = 0;
8
 
9
/* Support compiling the test to report individual failures; default is
10
   to abort as soon as a check fails.  */
11
#ifdef DBG
12
#include <stdio.h>
13
#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
14
#else
15
#define FAILURE abort ();
16
#endif
17
 
18
volatile _Decimal32 d32a, d32b, d32c;
19
volatile _Decimal64 d64a, d64b, d64c;
20
volatile _Decimal128 d128a, d128b, d128c;
21
 
22
void
23
init ()
24
{
25
  d32b = 123.456e94df;
26
  d64b = 12.3456789012345e383dd;
27
  d128b = 12345.6789012345678901e4000dl;
28
 
29
  d32c = 1.3df;
30
  d64c = 1.2dd;
31
  d128c = 1.1dl;
32
}
33
 
34
int
35
main ()
36
{
37
  d32a = (d32b, d32c);
38
  if (d32a != d32c)
39
    FAILURE
40
  d64a = (d64b, 7.89dd, d64c);
41
  if (d64a != d64c)
42
    FAILURE
43
  d128a = (45678.987654dl, d128c, d128b);
44
  if (d128a != d128b)
45
    FAILURE
46
  d128a = (d32b, d64b, d128b);
47
  if (d128a != d128b)
48
    FAILURE
49
  d32a = (d32b, 12, d64c);
50
  if (d32a != d64c)
51
    FAILURE;
52
  d64a = (d64b, d32b, 12);
53
  if (d64a != 12.0dd)
54
    FAILURE;
55
 
56
  return 0;
57
}

powered by: WebSVN 2.1.0

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