1 /* GDB self-test for each gdbarch.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "gdbsupport/selftest.h"
24 #include "selftest-arch.h"
25 #include "arch-utils.h"
29 static bool skip_arch (const char *arch
)
31 if (strcmp ("fr300", arch
) == 0)
37 if (strcmp ("powerpc:EC603e", arch
) == 0
38 || strcmp ("powerpc:e500mc", arch
) == 0
39 || strcmp ("powerpc:e500mc64", arch
) == 0
40 || strcmp ("powerpc:titan", arch
) == 0
41 || strcmp ("powerpc:vle", arch
) == 0
42 || strcmp ("powerpc:e5500", arch
) == 0
43 || strcmp ("powerpc:e6500", arch
) == 0)
52 /* Register a kind of selftest that calls the test function once for each
53 gdbarch known to GDB. */
56 register_test_foreach_arch (const std::string
&name
,
57 self_test_foreach_arch_function
*function
)
59 std::vector
<const char *> arches
= gdbarch_printable_names ();
60 for (const char *arch
: arches
)
68 struct gdbarch_info info
;
69 info
.bfd_arch_info
= bfd_scan_arch (arch
);
70 struct gdbarch
*gdbarch
= gdbarch_find_by_info (info
);
71 SELF_CHECK (gdbarch
!= NULL
);
77 = name
+ std::string ("::") + std::string (arch
);
78 register_test (test_name
, test_fn
);
85 /* Clear GDB internal state. */
87 reinit_frame_cache ();
89 } // namespace selftests
90 #endif /* GDB_SELF_TEST */