Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / c-c++-common / dfp / call-by-value.c
blobe7aea3076cf49c07591458d87fd47207425b33da
1 /* C99 6.9.1(9) Function definitions; parameter has automatic storage.
3 Test that actual parameters are passed by value and that modifications
4 made within functions are lost on function return. */
6 #include "dfp-dbg.h"
8 void foo32 (_Decimal32 z)
10 z = z + 1.0df;
13 void foo64 (_Decimal64 z)
15 z = z + 1.0dd;
18 void foo128 (_Decimal128 z)
20 z = z + 1.0dl;
23 int
24 main ()
26 _Decimal32 d32 = 1.1df;
27 _Decimal64 d64 = 1.2dd;
28 _Decimal128 d128 = 1.3dl;
30 foo32 (d32);
31 if (d32 != 1.1df)
32 FAILURE
34 foo64 (d64);
35 if (d64 != 1.2dd)
36 FAILURE
38 foo128 (d128);
39 if (d128 != 1.3dl)
40 FAILURE
42 FINISH