OSDN Git Service
(root)
/
pf3gnuchains
/
pf3gnuchains4x.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
2003-08-22 Michael Chastain <mec@shout.net>
[pf3gnuchains/pf3gnuchains4x.git]
/
gdb
/
testsuite
/
gdb.cp
/
anon-union.cc
1
2
struct Foo {
3
union {
4
int zero;
5
unsigned int one;
6
} num1;
7
struct X {
8
int rock;
9
unsigned int rock2;
10
};
11
union {
12
int pebble;
13
X x;
14
union {
15
int qux;
16
unsigned int mux;
17
};
18
unsigned int boulder;
19
};
20
union {
21
int paper;
22
unsigned int cloth;
23
};
24
union {
25
int two;
26
unsigned int three;
27
} num2;
28
};
29
30
union Bar {
31
int x;
32
unsigned int y;
33
};
34
35
36
int main()
37
{
38
Foo foo = {0, 0};
39
40
foo.paper = 33;
41
foo.pebble = 44;
42
foo.mux = 55;
43
44
Bar bar = {0};
45
46
union {
47
int z;
48
unsigned int w;
49
}; w = 0;
50
51
bar.x = 33;
52
53
w = 45;
54
55
}