1 /* { dg-options "-std=gnu99" } */
3 /* C99 6.5.2.2 Function calls.
4 Test structure passing and return values involving decimal floating
7 extern void abort (void);
10 /* Support compiling the test to report individual failures; default is
11 to abort as soon as a check fails. */
14 #define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
16 #define FAILURE abort ();
26 } nums = { 1.0dl, 'a', 2.0dd, 'b', 3.0df };
29 d32_field (struct example s)
35 d64_field (struct example s)
41 d128_field (struct example s)
47 dummy1_field (struct example s)
53 dummy2_field (struct example s)
59 ptr_d32_field (struct example *s)
65 ptr_d64_field (struct example *s)
71 ptr_d128_field (struct example *s)
77 ptr_dummy1_field (struct example *s)
83 ptr_dummy2_field (struct example *s)
92 if (d32_field (nums) != 3.0df) FAILURE
93 if (d64_field (nums) != 2.0dd) FAILURE
94 if (d128_field (nums) != 1.0dl) FAILURE
95 if (dummy1_field (nums) != 'a') FAILURE
96 if (dummy2_field (nums) != 'b') FAILURE
98 if (ptr_d32_field (&nums) != 3.0df) FAILURE
99 if (ptr_d64_field (&nums) != 2.0dd) FAILURE
100 if (ptr_d128_field (&nums) != 1.0dl) FAILURE
101 if (ptr_dummy1_field (&nums) != 'a') FAILURE
102 if (ptr_dummy2_field (&nums) != 'b') FAILURE