libabigail/tests/data/test-read-write/test6.xml
Dodji Seketeli 170885cfcc Support enum type declarations
* src/abg-ir.h (class enum_type_decl, struct enum_type_decl_hash):
	New declarations.
	* src/abg-ir.cc (dynamic_type_hash::operator()): Add hashing
	support for enum_type_decl.
	(enum_type_decl::enum_type_decl)
	(enum_type_decl::get_underlying_type)
	(enum_type_decl::get_enumerators, enum_type_decl::~enum_type_decl)
	(enum_type_decl::operator==): New definitions.
	* src/abg-reader.cc (handle_enum_type_decl): New definition.
	(handle_element): Handle "enum-decl" element.
	* src/abg-writer.cc (write_enum_type_decl): New.
	(write_decl): Add support to serialize enum_type_decl.
	* tests/test-read-write.cc: De-serialize and serialize
	data/test-read-write/test6.xml back.
	* tests/data/test-read-write/test6.xml: New test input.
	* tests/Makefile.am: Add it to the distribution.
2013-03-30 19:33:05 +01:00

23 lines
886 B
XML

<abi-instr version='1.0'>
<type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
<enum-decl name='enum_foo' id='type-id-2'>
<base type-id='type-id-1'/>
<enumerator name='e0' value='0'/>
<enumerator name='e1' value='1'/>
<enumerator name='e2' value='2'/>
<enumerator name='e3' value='2'/>
</enum-decl>
<namespace-decl name='foo'>
<type-decl name='int32' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/>
<enum-decl name='enum_foo' id='type-id-4'>
<base type-id='type-id-3'/>
<enumerator name='e0' value='0'/>
<enumerator name='e1' value='1'/>
<enumerator name='e2' value='2'/>
<enumerator name='e3' value='2'/>
<enumerator name='e4' value='2'/>
</enum-decl>
</namespace-decl>
<type-decl name='short int' size-in-bits='16' alignment-in-bits='16' id='type-id-5'/>
</abi-instr>