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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [fixuns-trunc-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-std=c99" } */
3
 
4
unsigned long foo(double d)
5
{
6
  return (unsigned long) d;
7
}
8
 
9
extern void abort(void);
10
 
11
int main(void)
12
{
13
  double d;
14
  unsigned long l;
15
 
16
#ifdef __LP64__
17
  d = 9223372036854775808.7;
18
  l = 1LL << 63;
19
 
20
  if (foo(d) != l)
21
    abort();
22
#endif
23
 
24
  d = 122485.2;
25
  l = 122485;
26
 
27
  if (foo(d) != l)
28
    abort();
29
 
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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