| 1 |
/* C99 6.5.2.2 Function calls. */ |
| 2 |
|
| 3 |
#include <stdarg.h> |
| 4 |
#include "dfp-dbg.h" |
| 5 |
|
| 6 |
struct S1 |
| 7 |
{ |
| 8 |
struct |
| 9 |
{ |
| 10 |
_Decimal64 e; |
| 11 |
} b[0]; |
| 12 |
}; |
| 13 |
|
| 14 |
/* Test handling vararg parameters whose size is 0. */ |
| 15 |
|
| 16 |
int check_var(int z,...) |
| 17 |
{ |
| 18 |
double d; |
| 19 |
struct S1 s1; |
| 20 |
long long result; |
| 21 |
va_list ap; |
| 22 |
va_start (ap, z); |
| 23 |
d = va_arg (ap, double); |
| 24 |
s1 = va_arg (ap, struct S1); |
| 25 |
result = va_arg (ap, long long); |
| 26 |
va_end (ap); |
| 27 |
return (result == 2LL); |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
int |
| 32 |
main () |
| 33 |
{ |
| 34 |
struct S1 s1; |
| 35 |
struct S1 a1[5]; |
| 36 |
|
| 37 |
if (check_var(5, 1.0, s1, 2LL, a1[2], a1[2]) == 0) |
| 38 |
FAILURE |
| 39 |
|
| 40 |
FINISH |
| 41 |
} |