mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 07:14:18 +08:00
38f12cfce2
* value.c (value_primitive_field): Take 'offset' into account for packed field. gdb/testsuite * gdb.base/anon.exp: New file. * gdb.base/anon.c: New file.
33 lines
373 B
C
33 lines
373 B
C
/* Test of anonymous union in a struct. */
|
|
|
|
#include <string.h>
|
|
|
|
struct outer
|
|
{
|
|
int one;
|
|
int two;
|
|
|
|
struct
|
|
{
|
|
union {
|
|
int three : 3;
|
|
int four : 4;
|
|
};
|
|
|
|
union {
|
|
int five : 3;
|
|
int six : 4;
|
|
};
|
|
} data;
|
|
};
|
|
|
|
int main ()
|
|
{
|
|
struct outer val;
|
|
|
|
memset (&val, 0, sizeof (val));
|
|
val.data.six = 6;
|
|
|
|
return 0; /* break here */
|
|
}
|