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/] [call-by-value.c] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99" } */
2
 
3
/* C99 6.9.1(9) Function definitions; parameter has automatic storage.
4
 
5
   Test that actual parameters are passed by value and that modifications
6
   made within functions are lost on function return.  */
7
 
8
extern void abort (void);
9
 
10
int foo32 (_Decimal32 z)
11
{
12
  z = z + 1.0df;
13
}
14
 
15
int foo64 (_Decimal64 z)
16
{
17
  z = z + 1.0dd;
18
}
19
 
20
int foo128 (_Decimal128 z)
21
{
22
  z = z + 1.0dl;
23
}
24
 
25
int
26
main ()
27
{
28
  _Decimal32 d32 = 1.1df;
29
  _Decimal64 d64 = 1.2dd;
30
  _Decimal128 d128 = 1.3dl;
31
 
32
  foo32 (d32);
33
  if (d32 != 1.1df)
34
    abort ();
35
 
36
  foo64 (d64);
37
  if (d64 != 1.2dd)
38
    abort ();
39
 
40
  foo128 (d128);
41
  if (d128 != 1.3dl)
42
    abort ();
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.