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] - Rev 867

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

/* { dg-do run } */
/* { dg-options "-std=c99" } */
 
unsigned long foo(double d)
{
  return (unsigned long) d;
}
 
extern void abort(void);
 
int main(void)
{
  double d;
  unsigned long l;
 
#ifdef __LP64__
  d = 9223372036854775808.7;
  l = 1LL << 63;
 
  if (foo(d) != l)
    abort();
#endif
 
  d = 122485.2;
  l = 122485;
 
  if (foo(d) != l)
    abort();
 
  return 0;
}
 

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

powered by: WebSVN 2.1.0

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