Ticket #8190: union_test.cpp

File union_test.cpp, 598 bytes (added by anevilyak, 13 years ago)
Line 
1
2typedef unsigned char uint8;
3typedef unsigned short uint16;
4typedef unsigned long long uint64;
5typedef uint64 target_addr_t;
6typedef signed long long off_t;
7class DebugInfoEntry;
8
9struct AttributeValue {
10 union {
11 target_addr_t address;
12 struct {
13 const void* data;
14 off_t length;
15 } block;
16 uint64 constant;
17 bool flag;
18 off_t pointer;
19 DebugInfoEntry* reference;
20 const char* string;
21 };
22
23 uint16 attributeForm;
24 uint8 attributeClass;
25 bool isSigned;
26};
27
28int main(int, char **)
29{
30 AttributeValue value;
31 value.address = 0x1234567890123456;
32
33 return 0;
34}