if (skip_arch (arch))
continue;
+ struct gdbarch_info info;
+ info.bfd_arch_info = bfd_scan_arch (arch);
+ info.osabi = GDB_OSABI_NONE;
+
auto test_fn
= ([=] ()
{
- struct gdbarch_info info;
- info.bfd_arch_info = bfd_scan_arch (arch);
- info.osabi = GDB_OSABI_NONE;
struct gdbarch *gdbarch = gdbarch_find_by_info (info);
SELF_CHECK (gdbarch != NULL);
function (gdbarch);
reset ();
});
- tests.emplace_back (string_printf ("%s::%s", name.c_str (), arch),
- test_fn);
+ std::string id;
+
+ bool has_sep = strchr (arch, ':') != nullptr;
+ if (has_sep)
+ /* Avoid avr::avr:1. */
+ id = arch;
+ else if (strncasecmp (info.bfd_arch_info->arch_name, arch,
+ strlen (info.bfd_arch_info->arch_name)) == 0)
+ /* Avoid arm::arm. */
+ id = arch;
+ else
+ /* Use arc::A6 instead of A6. This still leaves us with an unfortunate
+ redundant id like am33_2::am33-2, but that doesn't seem worth the
+ effort to avoid. */
+ id = string_printf ("%s::%s", info.bfd_arch_info->arch_name, arch);
+
+ id = string_printf ("%s::%s", name.c_str (), id.c_str ());
+ tests.emplace_back (id, test_fn);
}
return tests;
}