This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 5/7] Arm: Add xml unit tests
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: nd <nd at arm dot com>, Alan Hayward <Alan dot Hayward at arm dot com>
- Date: Fri, 5 Jul 2019 09:45:35 +0000
- Subject: [PATCH 5/7] Arm: Add xml unit tests
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- References: <20190705094525.51536-1-alan.hayward@arm.com>
Use the record_xml_tdesc tests to prove the new target descriptions
are identical to the previous xml file ones.
This is tested as part of gdb.gdb/unittest.exp.
gdb/ChangeLog:
2019-07-05 Alan Hayward <alan.hayward@arm.com>
* arm-tdep.c (_initialize_arm_tdep): Add xml regression tests.
---
gdb/arm-tdep.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 91a4a785ea..ea8b22d652 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -63,6 +63,7 @@
#if GDB_SELF_TEST
#include "common/selftest.h"
+#include "aarch32-tdep.h"
#endif
static int arm_debug;
@@ -9575,6 +9576,23 @@ vfp - VFP co-processor."),
#if GDB_SELF_TEST
selftests::register_test ("arm-record", selftests::arm_record_test);
+
+ const target_desc *tdesc;
+
+ tdesc = arm_read_description (ARM_FP_TYPE_VFPV2);
+ selftests::record_xml_tdesc ("arm/arm-with-vfpv2.xml", tdesc);
+ tdesc = arm_read_description (ARM_FP_TYPE_VFPV3);
+ selftests::record_xml_tdesc ("arm/arm-with-vfpv3.xml",tdesc);
+ tdesc = arm_read_description (ARM_FP_TYPE_IWMMXT);
+ selftests::record_xml_tdesc ("arm/arm-with-iwmmxt.xml", tdesc);
+ tdesc = arm_create_mprofile_target_description (ARM_M_TYPE_M_PROFILE);
+ selftests::record_xml_tdesc ("arm/arm-with-m.xml", tdesc);
+ tdesc = arm_create_mprofile_target_description (ARM_M_TYPE_VFP_D16);
+ selftests::record_xml_tdesc ("arm/arm-with-m-vfp-d16.xml", tdesc);
+ tdesc = arm_create_mprofile_target_description (ARM_M_TYPE_WITH_FPA);
+ selftests::record_xml_tdesc ("arm/arm-with-m-fpa-layout.xml", tdesc);
+ tdesc = aarch32_read_description ();
+ selftests::record_xml_tdesc ("arm/arm-with-neon.xml", tdesc);
#endif
}
--
2.20.1 (Apple Git-117)