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