1 // SPDX-License-Identifier: GPL-2.0
2 #include <string.h>
3 #include "tests/tests.h"
4 #include "arch-tests.h"
5 
6 #ifdef HAVE_AUXTRACE_SUPPORT
7 DEFINE_SUITE("x86 instruction decoder - new instructions", insn_x86);
8 
9 static struct test_case intel_pt_tests[] = {
10 	TEST_CASE("Intel PT packet decoder", intel_pt_pkt_decoder),
11 	TEST_CASE("Intel PT hybrid CPU compatibility", intel_pt_hybrid_compat),
12 	{ .name = NULL, }
13 };
14 
15 struct test_suite suite__intel_pt = {
16 	.desc = "Intel PT",
17 	.test_cases = intel_pt_tests,
18 };
19 
20 #endif
21 #if defined(__x86_64__)
22 DEFINE_SUITE("x86 bp modify", bp_modify);
23 #endif
24 DEFINE_SUITE("x86 Sample parsing", x86_sample_parsing);
25 static struct test_case hybrid_tests[] = {
26 	TEST_CASE_REASON("x86 hybrid event parsing", hybrid, "not hybrid"),
27 	{ .name = NULL, }
28 };
29 
30 struct test_suite suite__hybrid = {
31 	.desc = "x86 hybrid",
32 	.test_cases = hybrid_tests,
33 };
34 
35 struct test_suite *arch_tests[] = {
36 #ifdef HAVE_DWARF_UNWIND_SUPPORT
37 	&suite__dwarf_unwind,
38 #endif
39 #ifdef HAVE_AUXTRACE_SUPPORT
40 	&suite__insn_x86,
41 	&suite__intel_pt,
42 #endif
43 #if defined(__x86_64__)
44 	&suite__bp_modify,
45 #endif
46 	&suite__x86_sample_parsing,
47 	&suite__hybrid,
48 	NULL,
49 };
50