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/] [call-by-value.c] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* { dg-options "-std=gnu99" } */
/* { dg-options "-std=gnu99" } */
 
 
/* C99 6.9.1(9) Function definitions; parameter has automatic storage.
/* C99 6.9.1(9) Function definitions; parameter has automatic storage.
 
 
   Test that actual parameters are passed by value and that modifications
   Test that actual parameters are passed by value and that modifications
   made within functions are lost on function return.  */
   made within functions are lost on function return.  */
 
 
extern void abort (void);
extern void abort (void);
 
 
int foo32 (_Decimal32 z)
int foo32 (_Decimal32 z)
{
{
  z = z + 1.0df;
  z = z + 1.0df;
}
}
 
 
int foo64 (_Decimal64 z)
int foo64 (_Decimal64 z)
{
{
  z = z + 1.0dd;
  z = z + 1.0dd;
}
}
 
 
int foo128 (_Decimal128 z)
int foo128 (_Decimal128 z)
{
{
  z = z + 1.0dl;
  z = z + 1.0dl;
}
}
 
 
int
int
main ()
main ()
{
{
  _Decimal32 d32 = 1.1df;
  _Decimal32 d32 = 1.1df;
  _Decimal64 d64 = 1.2dd;
  _Decimal64 d64 = 1.2dd;
  _Decimal128 d128 = 1.3dl;
  _Decimal128 d128 = 1.3dl;
 
 
  foo32 (d32);
  foo32 (d32);
  if (d32 != 1.1df)
  if (d32 != 1.1df)
    abort ();
    abort ();
 
 
  foo64 (d64);
  foo64 (d64);
  if (d64 != 1.2dd)
  if (d64 != 1.2dd)
    abort ();
    abort ();
 
 
  foo128 (d128);
  foo128 (d128);
  if (d128 != 1.3dl)
  if (d128 != 1.3dl)
    abort ();
    abort ();
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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