Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / perf / arch / arm64 / tests / cpuid-match.c
blobe8e3947cca18c7d6d23d4202210950823a152a13
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/compiler.h>
4 #include "arch-tests.h"
5 #include "tests/tests.h"
6 #include "util/header.h"
8 int test__cpuid_match(struct test_suite *test __maybe_unused,
9 int subtest __maybe_unused)
11 /* midr with no leading zeros matches */
12 if (strcmp_cpuid_str("0x410fd0c0", "0x00000000410fd0c0"))
13 return -1;
14 /* Upper case matches */
15 if (strcmp_cpuid_str("0x410fd0c0", "0x00000000410FD0C0"))
16 return -1;
17 /* r0p0 = r0p0 matches */
18 if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000410fd480"))
19 return -1;
20 /* r0p1 > r0p0 matches */
21 if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000410fd481"))
22 return -1;
23 /* r1p0 > r0p0 matches*/
24 if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000411fd480"))
25 return -1;
26 /* r0p0 < r0p1 doesn't match */
27 if (!strcmp_cpuid_str("0x00000000410fd481", "0x00000000410fd480"))
28 return -1;
29 /* r0p0 < r1p0 doesn't match */
30 if (!strcmp_cpuid_str("0x00000000411fd480", "0x00000000410fd480"))
31 return -1;
32 /* Different CPU doesn't match */
33 if (!strcmp_cpuid_str("0x00000000410fd4c0", "0x00000000430f0af0"))
34 return -1;
36 return 0;