| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
#include <string.h> |
| 6 |
|
| 7 |
union S8302 |
| 8 |
{ |
| 9 |
union |
| 10 |
{ |
| 11 |
double b; |
| 12 |
int c; |
| 13 |
} a; |
| 14 |
long double d; |
| 15 |
unsigned short int f[5]; |
| 16 |
}; |
| 17 |
|
| 18 |
union S8302 s8302; |
| 19 |
extern void check8302va (int i, ...); |
| 20 |
|
| 21 |
int |
| 22 |
main (void) |
| 23 |
{ |
| 24 |
memset (&s8302, '\0', sizeof (s8302)); |
| 25 |
s8302.a.b = -221438.250000; |
| 26 |
check8302va (1, s8302); |
| 27 |
return 0; |
| 28 |
} |
| 29 |
|
| 30 |
__attribute__((noinline, noclone)) |
| 31 |
void |
| 32 |
check8302va (int z, ...) |
| 33 |
{ |
| 34 |
union S8302 arg, *p; |
| 35 |
va_list ap; |
| 36 |
|
| 37 |
__builtin_va_start (ap, z); |
| 38 |
p = &s8302; |
| 39 |
arg = __builtin_va_arg (ap, union S8302); |
| 40 |
if (p->a.b != arg.a.b) |
| 41 |
__builtin_abort (); |
| 42 |
__builtin_va_end (ap); |
| 43 |
} |