• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["external_linux-kselftest_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34//
35// large-scale-change included anything that looked like it might be a license
36// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
37//
38// Please consider removing redundant or irrelevant files from 'license_text:'.
39// See: http://go/android-license-faq
40license {
41    name: "external_linux-kselftest_license",
42    visibility: [":__subpackages__"],
43    license_kinds: [
44        "SPDX-license-identifier-Apache-2.0",
45        "SPDX-license-identifier-BSD-2-Clause",
46        "SPDX-license-identifier-BSD-3-Clause",
47        "SPDX-license-identifier-CC0-1.0",
48        "SPDX-license-identifier-GPL",
49        "SPDX-license-identifier-GPL-2.0",
50        "SPDX-license-identifier-GPL-3.0",
51        "SPDX-license-identifier-LGPL",
52        "SPDX-license-identifier-LGPL-2.1",
53        "SPDX-license-identifier-MIT",
54        "SPDX-license-identifier-Unlicense",
55    ],
56    license_text: [
57        "COPYING",
58        "NOTICE",
59    ],
60}
61
62cc_defaults {
63    name: "kselftest_defaults",
64    cflags: [
65        // Hacks for bionic compatibility
66        "-include bionic-compat.h",
67
68        "-Wall",
69
70        // Silence noisy warnings
71        "-Wno-deprecated",
72        "-Wno-format",
73        "-Wno-gnu-designator",
74        "-Wno-macro-redefined",
75        "-Wno-missing-field-initializers",
76        "-Wno-parentheses-equality",
77        "-Wno-pointer-arith",
78        "-Wno-sign-compare",
79        "-Wno-shift-negative-value",
80        "-Wno-switch",
81        "-Wno-absolute-value",
82        "-Wno-non-literal-null-conversion",
83        "-Wno-unused-value",
84        "-Wno-unused-variable",
85        "-Wno-unused-parameter",
86        "-Wno-empty-body",
87        "-Wno-literal-conversion",
88        "-Werror",
89    ],
90
91    local_include_dirs: ["android/include"],
92    gtest: false,
93    no_named_install_directory: true,
94
95    test_per_src: true,
96
97    // FIXME: test fails to build with LTO
98    // http://b/241723066
99    lto: {
100        never: true,
101    },
102}
103
104// binderfs test
105cc_test {
106    name: "kselftest_binderfs_tests",
107    relative_install_path: "linux-kselftest/filesystems/binderfs",
108    srcs: ["tools/testing/selftests/filesystems/binderfs/binderfs_test.c"],
109    defaults: ["kselftest_defaults"],
110}
111
112// breakpoints test
113cc_test {
114    name: "kselftest_breakpoints_tests",
115    relative_install_path: "linux-kselftest/breakpoints",
116    srcs: [
117        "tools/testing/selftests/breakpoints/step_after_suspend_test.c",
118    ],
119    defaults: ["kselftest_defaults"],
120    arch: {
121        arm: {
122            enabled: false,
123        },
124        riscv64: {
125            enabled: false,
126        },
127        arm64: {
128            srcs: [
129                "tools/testing/selftests/breakpoints/breakpoint_test_arm64.c",
130            ],
131        },
132        x86: {
133            srcs: [
134                "tools/testing/selftests/breakpoints/breakpoint_test.c",
135            ],
136        },
137        x86_64: {
138            srcs: [
139                "tools/testing/selftests/breakpoints/breakpoint_test.c",
140            ],
141        },
142    },
143}
144
145// capabilities test
146cc_test {
147    name: "kselftest_capabilities_test",
148    relative_install_path: "linux-kselftest/capabilities",
149    srcs: [
150        "tools/testing/selftests/capabilities/test_execve.c",
151        "tools/testing/selftests/capabilities/validate_cap.c",
152    ],
153    defaults: ["kselftest_defaults"],
154    static_libs: ["libcap-ng"],
155}
156
157// Cpu-hotplug test
158sh_test {
159    name: "kselftest_cpu-hotplug_cpu-on-off-test",
160    sub_dir: "linux-kselftest/cpu-hotplug",
161    src: "tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh",
162    filename_from_src: true,
163    compile_multilib: "both",
164}
165
166// Efivarfs test
167cc_test {
168    name: "kselftest_efivarfs_tests",
169    relative_install_path: "linux-kselftest/efivarfs",
170    srcs: [
171        "tools/testing/selftests/efivarfs/open-unlink.c",
172        "tools/testing/selftests/efivarfs/create-read.c",
173    ],
174    defaults: ["kselftest_defaults"],
175}
176
177sh_test {
178    name: "kselftest_efivarfs_efivarfs",
179    sub_dir: "linux-kselftest/efivarfs",
180    src: "tools/testing/selftests/efivarfs/efivarfs.sh",
181    filename_from_src: true,
182    compile_multilib: "both",
183}
184
185// Exec test
186cc_test {
187    name: "kselftest_exec_test",
188    relative_install_path: "linux-kselftest/exec",
189    srcs: [
190        "tools/testing/selftests/exec/execveat.c",
191    ],
192    defaults: ["kselftest_defaults"],
193}
194
195sh_test {
196    name: "kselftest_exec_execveat.sh",
197    sub_dir: "linux-kselftest/exec",
198    src: "tools/testing/selftests/exec/execveat.sh",
199    filename_from_src: true,
200    compile_multilib: "both",
201}
202
203// Firmware test
204sh_test {
205    name: "kselftest_firmware_fw_fallback",
206    sub_dir: "linux-kselftest/firmware",
207    src: "tools/testing/selftests/firmware/fw_fallback.sh",
208    filename_from_src: true,
209    compile_multilib: "both",
210}
211
212sh_test {
213    name: "kselftest_firmware_fw_filesystem",
214    sub_dir: "linux-kselftest/firmware",
215    src: "tools/testing/selftests/firmware/fw_filesystem.sh",
216    filename_from_src: true,
217    compile_multilib: "both",
218}
219
220// Ftrace test
221sh_test {
222    name: "kselftest_ftrace_ftracetest",
223    sub_dir: "linux-kselftest/ftrace",
224    src: "tools/testing/selftests/ftrace/ftracetest",
225    filename_from_src: true,
226    compile_multilib: "both",
227}
228
229sh_test {
230    name: "kselftest_ftrace_test.d_functions",
231    sub_dir: "linux-kselftest/ftrace/test.d",
232    src: "tools/testing/selftests/ftrace/test.d/functions",
233    filename_from_src: true,
234    compile_multilib: "both",
235}
236
237sh_test {
238    name: "kselftest_ftrace_test.d_00basic_basic2",
239    sub_dir: "linux-kselftest/ftrace/test.d/00basic",
240    src: "tools/testing/selftests/ftrace/test.d/00basic/basic2.tc",
241    filename_from_src: true,
242    compile_multilib: "both",
243}
244
245sh_test {
246    name: "kselftest_ftrace_test.d_00basic_basic4",
247    sub_dir: "linux-kselftest/ftrace/test.d/00basic",
248    src: "tools/testing/selftests/ftrace/test.d/00basic/basic4.tc",
249    filename_from_src: true,
250    compile_multilib: "both",
251}
252
253sh_test {
254    name: "kselftest_ftrace_test.d_00basic_basic1",
255    sub_dir: "linux-kselftest/ftrace/test.d/00basic",
256    src: "tools/testing/selftests/ftrace/test.d/00basic/basic1.tc",
257    filename_from_src: true,
258    compile_multilib: "both",
259}
260
261sh_test {
262    name: "kselftest_ftrace_test.d_00basic_basic3",
263    sub_dir: "linux-kselftest/ftrace/test.d/00basic",
264    src: "tools/testing/selftests/ftrace/test.d/00basic/basic3.tc",
265    filename_from_src: true,
266    compile_multilib: "both",
267}
268
269sh_test {
270    name: "kselftest_ftrace_test.d_template",
271    sub_dir: "linux-kselftest/ftrace/test.d",
272    src: "tools/testing/selftests/ftrace/test.d/template",
273    filename_from_src: true,
274    compile_multilib: "both",
275}
276
277sh_test {
278    name: "kselftest_ftrace_test.d_instances_instance",
279    sub_dir: "linux-kselftest/ftrace/test.d/instances",
280    src: "tools/testing/selftests/ftrace/test.d/instances/instance.tc",
281    filename_from_src: true,
282    compile_multilib: "both",
283}
284
285sh_test {
286    name: "kselftest_ftrace_test.d_instances_instance-event",
287    sub_dir: "linux-kselftest/ftrace/test.d/instances",
288    src: "tools/testing/selftests/ftrace/test.d/instances/instance-event.tc",
289    filename_from_src: true,
290    compile_multilib: "both",
291}
292
293// Futex test
294cc_test {
295    name: "kselftest_futex_tests",
296    relative_install_path: "linux-kselftest/futex/functional",
297    srcs: [
298        "tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c",
299        "tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c",
300        "tools/testing/selftests/futex/functional/futex_requeue_pi.c",
301        "tools/testing/selftests/futex/functional/futex_requeue.c",
302        "tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c",
303        "tools/testing/selftests/futex/functional/futex_wait_timeout.c",
304        "tools/testing/selftests/futex/functional/futex_wait_uninitialized_heap.c",
305        "tools/testing/selftests/futex/functional/futex_wait_wouldblock.c",
306        "tools/testing/selftests/futex/functional/futex_wait.c",
307        "tools/testing/selftests/futex/functional/futex_waitv.c",
308    ],
309    local_include_dirs: [
310        "tools/testing/selftests/futex/include",
311        "tools/testing/selftests",
312    ],
313    cflags: [
314        "-D_GNU_SOURCE",
315        "-pthread",
316    ],
317    defaults: ["kselftest_defaults"],
318}
319
320sh_test {
321    name: "kselftest_futex_functional_run.sh",
322    sub_dir: "linux-kselftest/futex/functional",
323    src: "tools/testing/selftests/futex/functional/run.sh",
324    filename_from_src: true,
325    compile_multilib: "both",
326}
327
328// intel_pstate test
329cc_test {
330    name: "kselftest_intel_pstate_tests",
331    relative_install_path: "linux-kselftest/intel_pstate",
332    srcs: [
333        "tools/testing/selftests/intel_pstate/aperf.c",
334        "tools/testing/selftests/intel_pstate/msr.c",
335    ],
336    cflags: [
337        "-D_GNU_SOURCE",
338    ],
339    defaults: ["kselftest_defaults"],
340    // TODO: test_data: intel_pstate/run.sh
341}
342
343sh_test {
344    name: "kselftest_intel_pstate_run.sh",
345    sub_dir: "linux-kselftest/intel_pstate",
346    src: "tools/testing/selftests/intel_pstate/run.sh",
347    filename_from_src: true,
348    compile_multilib: "both",
349}
350
351// Kcmp test
352cc_test {
353    name: "kselftest_kcmp_tests",
354    relative_install_path: "linux-kselftest/kcmp",
355    srcs: ["tools/testing/selftests/kcmp/kcmp_test.c"],
356    defaults: ["kselftest_defaults"],
357}
358
359// KVM test
360cc_test {
361    name: "kselftest_kvm_arm64_tests",
362    relative_install_path: "linux-kselftest/kvm/aarch64",
363    local_include_dirs: [
364        "tools/testing/selftests/kvm/include",
365        "tools/testing/selftests",
366    ],
367    enabled: false,
368    arch: {
369        arm64: {
370            enabled: true,
371            srcs: [
372                "tools/testing/selftests/kvm/aarch64/pvm_wipe_mem.c",
373            ],
374            cflags: [
375                "-fno-stack-protector",
376                "-fno-PIE",
377            ],
378        },
379    },
380    defaults: ["kselftest_defaults"],
381}
382
383// Lib test
384sh_test {
385    name: "kselftest_lib_printf",
386    sub_dir: "linux-kselftest/lib",
387    src: "tools/testing/selftests/lib/printf.sh",
388    filename_from_src: true,
389    compile_multilib: "both",
390}
391
392sh_test {
393    name: "kselftest_lib_bitmap",
394    sub_dir: "linux-kselftest/lib",
395    src: "tools/testing/selftests/lib/bitmap.sh",
396    filename_from_src: true,
397    compile_multilib: "both",
398}
399
400// media_tests test
401cc_test {
402    name: "kselftest_media_tests",
403    relative_install_path: "linux-kselftest/media_tests",
404    srcs: [
405        "tools/testing/selftests/media_tests/media_device_test.c",
406        "tools/testing/selftests/media_tests/media_device_open.c",
407        "tools/testing/selftests/media_tests/video_device_test.c",
408    ],
409    defaults: ["kselftest_defaults"],
410}
411
412// Membarrier test
413cc_test {
414    name: "kselftest_membarrier_tests",
415    relative_install_path: "linux-kselftest/membarrier",
416    srcs: [
417        "tools/testing/selftests/membarrier/membarrier_test_multi_thread.c",
418        "tools/testing/selftests/membarrier/membarrier_test_single_thread.c",
419    ],
420    defaults: ["kselftest_defaults"],
421}
422
423// Memory-hotplug test
424sh_test {
425    name: "kselftest_memory-hotplug_mem-on-off-test",
426    sub_dir: "linux-kselftest/memory-hotplug",
427    src: "tools/testing/selftests/memory-hotplug/mem-on-off-test.sh",
428    filename_from_src: true,
429    compile_multilib: "both",
430}
431
432// Mount test
433cc_test {
434    name: "kselftest_mount_tests",
435    relative_install_path: "linux-kselftest/mount",
436    srcs: ["tools/testing/selftests/mount/unprivileged-remount-test.c"],
437    defaults: ["kselftest_defaults"],
438}
439
440// Net test
441cc_test {
442    name: "kselftest_net_tests",
443    relative_install_path: "linux-kselftest/net",
444    srcs: [
445        "tools/testing/selftests/net/socket.c",
446        "tools/testing/selftests/net/psock_fanout.c",
447        "tools/testing/selftests/net/psock_tpacket.c",
448        "tools/testing/selftests/net/reuseport_dualstack.c",
449        "tools/testing/selftests/net/reuseaddr_conflict.c",
450    ],
451    defaults: ["kselftest_defaults"],
452    // TODO: test_data: net/test_bpf.sh
453}
454
455sh_test {
456    name: "kselftest_net_test_bpf",
457    sub_dir: "linux-kselftest/net",
458    src: "tools/testing/selftests/net/test_bpf.sh",
459    filename_from_src: true,
460    compile_multilib: "both",
461}
462
463// Pstore test
464sh_test {
465    name: "kselftest_pstore_pstore_tests",
466    sub_dir: "linux-kselftest/pstore",
467    src: "tools/testing/selftests/pstore/pstore_tests",
468    filename_from_src: true,
469    compile_multilib: "both",
470}
471
472sh_test {
473    name: "kselftest_pstore_pstore_post_reboot_tests",
474    sub_dir: "linux-kselftest/pstore",
475    src: "tools/testing/selftests/pstore/pstore_post_reboot_tests",
476    filename_from_src: true,
477    compile_multilib: "both",
478}
479
480sh_test {
481    name: "kselftest_pstore_common_tests",
482    sub_dir: "linux-kselftest/pstore",
483    src: "tools/testing/selftests/pstore/common_tests",
484    filename_from_src: true,
485    compile_multilib: "both",
486}
487
488sh_test {
489    name: "kselftest_pstore_pstore_crash_test",
490    sub_dir: "linux-kselftest/pstore",
491    src: "tools/testing/selftests/pstore/pstore_crash_test",
492    filename_from_src: true,
493    compile_multilib: "both",
494}
495
496// Ptrace test
497cc_test {
498    name: "kselftest_ptrace_tests",
499    relative_install_path: "linux-kselftest/ptrace",
500    srcs: ["tools/testing/selftests/ptrace/peeksiginfo.c"],
501    defaults: ["kselftest_defaults"],
502}
503
504// rtc test
505cc_test {
506    name: "kselftest_rtc_tests",
507    relative_install_path: "linux-kselftest/rtc",
508    srcs: ["tools/testing/selftests/rtc/rtctest.c"],
509    defaults: ["kselftest_defaults"],
510}
511
512// seccomp test
513cc_test {
514    name: "kselftest_seccomp_tests",
515    relative_install_path: "linux-kselftest/seccomp",
516    srcs: ["tools/testing/selftests/seccomp/seccomp_bpf.c"],
517    defaults: ["kselftest_defaults"],
518}
519
520// size test
521cc_test {
522    name: "kselftest_size_test",
523    relative_install_path: "linux-kselftest/size",
524    srcs: ["tools/testing/selftests/size/get_size.c"],
525    arch: {
526       x86_64: {
527           cflags: ["-mstackrealign"],
528       },
529    },
530    defaults: ["kselftest_defaults"],
531    nocrt: true,
532    // coverage runtime calls atexit, which is unavailable with nocrt.
533    native_coverage: false,
534}
535
536// splice test
537cc_test {
538    name: "kselftest_splice_test",
539    relative_install_path: "linux-kselftest/splice",
540    srcs: ["tools/testing/selftests/splice/default_file_splice_read.c"],
541    defaults: ["kselftest_defaults"],
542}
543
544sh_test {
545    name: "kselftest_splice_default_file_splice_read.sh",
546    sub_dir: "linux-kselftest/splice",
547    src: "tools/testing/selftests/splice/default_file_splice_read.sh",
548    filename_from_src: true,
549    compile_multilib: "both",
550}
551
552// Static keys test
553sh_test {
554    name: "kselftest_static_keys_test_static_keys",
555    sub_dir: "linux-kselftest/static_keys",
556    src: "tools/testing/selftests/static_keys/test_static_keys.sh",
557    filename_from_src: true,
558    compile_multilib: "both",
559}
560
561// Timer test
562cc_test {
563    name: "kselftest_timer_tests",
564    relative_install_path: "linux-kselftest/timers",
565    srcs: [
566        "tools/testing/selftests/timers/adjtick.c",
567        "tools/testing/selftests/timers/alarmtimer-suspend.c",
568        "tools/testing/selftests/timers/change_skew.c",
569        "tools/testing/selftests/timers/clocksource-switch.c",
570        "tools/testing/selftests/timers/freq-step.c",
571        "tools/testing/selftests/timers/inconsistency-check.c",
572        "tools/testing/selftests/timers/leap-a-day.c",
573        "tools/testing/selftests/timers/leapcrash.c",
574        "tools/testing/selftests/timers/nanosleep.c",
575        "tools/testing/selftests/timers/nsleep-lat.c",
576        "tools/testing/selftests/timers/posix_timers.c",
577        "tools/testing/selftests/timers/raw_skew.c",
578        "tools/testing/selftests/timers/set-2038.c",
579        "tools/testing/selftests/timers/set-tai.c",
580        "tools/testing/selftests/timers/set-timer-lat.c",
581        "tools/testing/selftests/timers/set-tz.c",
582        "tools/testing/selftests/timers/skew_consistency.c",
583        "tools/testing/selftests/timers/threadtest.c",
584        "tools/testing/selftests/timers/valid-adjtimex.c",
585    ],
586    cflags: [
587        "-O3",
588        "-DKTEST",
589    ],
590    defaults: ["kselftest_defaults"],
591}
592
593// User test
594sh_test {
595    name: "kselftest_user_test_user_copy",
596    sub_dir: "linux-kselftest/user",
597    src: "tools/testing/selftests/user/test_user_copy.sh",
598    filename_from_src: true,
599    compile_multilib: "both",
600}
601
602// vdso test
603cc_test {
604    name: "kselftest_vdso_test_abi",
605    relative_install_path: "linux-kselftest/vDSO",
606    srcs: [
607        "tools/testing/selftests/vDSO/parse_vdso.c",
608        "tools/testing/selftests/vDSO/vdso_test_abi.c",
609    ],
610    defaults: ["kselftest_defaults"],
611    test_per_src: false,
612}
613
614cc_test {
615    name: "kselftest_vdso_test_clock_getres",
616    relative_install_path: "linux-kselftest/vDSO",
617    srcs: [
618        "tools/testing/selftests/vDSO/parse_vdso.c",
619        "tools/testing/selftests/vDSO/vdso_test_clock_getres.c",
620    ],
621    defaults: ["kselftest_defaults"],
622    test_per_src: false,
623}
624
625cc_test {
626    name: "kselftest_vdso_test_correctness",
627    relative_install_path: "linux-kselftest/vDSO",
628    srcs: [
629        "tools/testing/selftests/vDSO/parse_vdso.c",
630        "tools/testing/selftests/vDSO/vdso_test_correctness.c",
631    ],
632    static_libs: [
633        "libdl",
634    ],
635    defaults: ["kselftest_defaults"],
636    test_per_src: false,
637    enabled: false,
638}
639
640cc_test {
641    name: "kselftest_vdso_test_getcpu",
642    relative_install_path: "linux-kselftest/vDSO",
643    srcs: [
644        "tools/testing/selftests/vDSO/parse_vdso.c",
645        "tools/testing/selftests/vDSO/vdso_test_getcpu.c",
646    ],
647    defaults: ["kselftest_defaults"],
648    test_per_src: false,
649}
650
651cc_test {
652    name: "kselftest_vdso_test_gettimeofday",
653    relative_install_path: "linux-kselftest/vDSO",
654    srcs: [
655        "tools/testing/selftests/vDSO/parse_vdso.c",
656        "tools/testing/selftests/vDSO/vdso_test_gettimeofday.c",
657    ],
658    defaults: ["kselftest_defaults"],
659    test_per_src: false,
660}
661
662// Vm test
663cc_test {
664    name: "kselftest_vm_tests",
665    relative_install_path: "linux-kselftest/vm",
666    srcs: [
667        "tools/testing/selftests/vm/compaction_test.c",
668        "tools/testing/selftests/vm/hugepage-mmap.c",
669        "tools/testing/selftests/vm/hugepage-shm.c",
670        "tools/testing/selftests/vm/map_hugetlb.c",
671        "tools/testing/selftests/vm/mlock-random-test.c",
672        "tools/testing/selftests/vm/mlock2-tests.c",
673        "tools/testing/selftests/vm/on-fault-limit.c",
674        "tools/testing/selftests/vm/mremap_dontunmap.c",
675        "tools/testing/selftests/vm/mremap_test.c",
676        "tools/testing/selftests/vm/userfaultfd.c",
677        "tools/testing/selftests/vm/thuge-gen.c",
678        "tools/testing/selftests/vm/transhuge-stress.c",
679    ],
680    defaults: ["kselftest_defaults"],
681    static_libs: ["libcap"],
682}
683
684cc_test {
685    name: "kselftest_vm64_tests",
686    relative_install_path: "linux-kselftest/vm",
687    srcs: [
688        "tools/testing/selftests/vm/virtual_address_range.c",
689    ],
690    defaults: ["kselftest_defaults"],
691    enabled: false,
692    arch: {
693        arm64: {
694            enabled: true,
695            cflags: ["-D__aarch64__"],
696        },
697    },
698}
699
700sh_test {
701    name: "kselftest_vm_run_vmtests",
702    sub_dir: "linux-kselftest/vm",
703    src: "tools/testing/selftests/vm/run_vmtests.sh",
704    filename_from_src: true,
705    compile_multilib: "both",
706}
707
708// x86 tests
709cc_test {
710    name: "kselftest_x86_tests",
711    relative_install_path: "linux-kselftest/x86",
712    srcs: [
713        "tools/testing/selftests/x86/single_step_syscall.c",
714        "tools/testing/selftests/x86/syscall_nt.c",
715        "tools/testing/selftests/x86/test_mremap_vdso.c",
716        "tools/testing/selftests/x86/ldt_gdt.c",
717        "tools/testing/selftests/x86/syscall_arg_fault.c",
718    ],
719    arch: {
720        arm: {
721            enabled: false,
722        },
723        arm64: {
724            enabled: false,
725        },
726        x86_64: {
727            enabled: true,
728            static_libs: [
729                "libdl",
730            ],
731        },
732        x86: {
733            srcs: [
734                //"tools/testing/selftests/x86/entry_from_vm86.c",
735                "tools/testing/selftests/x86/unwind_vdso.c",
736                "tools/testing/selftests/x86/test_FCMOV.c",
737                "tools/testing/selftests/x86/test_FCOMI.c",
738                "tools/testing/selftests/x86/test_FISTTP.c",
739                "tools/testing/selftests/x86/vdso_restorer.c",
740            ],
741            static_libs: [
742                "libdl",
743            ],
744        },
745        riscv64: {
746            enabled: false,
747        },
748    },
749    cflags: [
750        "-O2",
751        "-pthread",
752    ],
753    c_std: "gnu99",
754    static_executable: true,
755    defaults: ["kselftest_defaults"],
756}
757
758cc_test {
759    name: "kselftest_x86_check_initial_reg_state",
760    stem: "check_initial_reg_state",
761    relative_install_path: "linux-kselftest/x86",
762    srcs: [
763        "tools/testing/selftests/x86/check_initial_reg_state.c",
764    ],
765    arch: {
766        arm: {
767            enabled: false,
768        },
769        arm64: {
770            enabled: false,
771        },
772        x86: {
773            enabled: true,
774        },
775        x86_64: {
776            enabled: true,
777        },
778        riscv64: {
779            enabled: false,
780        },
781    },
782    cflags: [
783        "-O2",
784        "-pthread",
785    ],
786    c_std: "gnu99",
787    // check_initial_reg_state is special: it needs a custom entry, and it needs to be static so
788    // that its interpreter doesn't destroy its initial state.
789    ldflags: ["-Wl,-ereal_start"],
790    static_executable: true,
791    test_per_src: false,
792    defaults: ["kselftest_defaults"],
793}
794
795cc_test {
796    name: "kselftest_x86_ptrace_syscall",
797    stem: "ptrace_syscall",
798    relative_install_path: "linux-kselftest/x86",
799    srcs: [
800        "tools/testing/selftests/x86/ptrace_syscall.c",
801    ],
802    cflags: [
803        "-O2",
804        "-pthread",
805    ],
806    c_std: "gnu99",
807    test_per_src: false,
808    defaults: ["kselftest_defaults"],
809    enabled: false,
810    arch: {
811        x86: {
812            enabled: true,
813            srcs: [
814                "tools/testing/selftests/x86/raw_syscall_helper_32.S",
815            ],
816        },
817        x86_64: {
818            enabled: true,
819        },
820    },
821}
822
823cc_test {
824    name: "kselftest_x86_test_sysret_ss_attrs",
825    stem: "sysret_ss_attrs",
826    relative_install_path: "linux-kselftest/x86",
827    srcs: [
828        "tools/testing/selftests/x86/sysret_ss_attrs.c",
829    ],
830    cflags: [
831        "-O2",
832        "-pthread",
833    ],
834    c_std: "gnu99",
835    static_executable: true,
836    test_per_src: false,
837    defaults: ["kselftest_defaults"],
838    enabled: false,
839    arch: {
840        x86: {
841            enabled: true,
842            srcs: [
843                "tools/testing/selftests/x86/thunks_32.S",
844            ],
845        },
846        x86_64: {
847            enabled: true,
848            srcs: [
849                "tools/testing/selftests/x86/thunks.S",
850            ],
851        },
852        riscv64: {
853            enabled: false,
854        },
855    },
856}
857
858cc_test {
859    name: "kselftest_x86_test_syscall_vdso",
860    stem: "test_syscall_vdso",
861    relative_install_path: "linux-kselftest/x86",
862    srcs: [
863        "tools/testing/selftests/x86/test_syscall_vdso.c",
864        "tools/testing/selftests/x86/thunks_32.S",
865    ],
866    cflags: [
867        "-O2",
868        "-pthread",
869    ],
870    c_std: "gnu99",
871    static_executable: true,
872    test_per_src: false,
873    defaults: ["kselftest_defaults"],
874    enabled: false,
875    arch: {
876        x86: {
877            enabled: true,
878        },
879        riscv64: {
880            enabled: false,
881        },
882    },
883}
884
885// zram tests
886sh_test {
887    name: "kselftest_zram_zram.sh",
888    sub_dir: "linux-kselftest/zram",
889    src: "tools/testing/selftests/zram/zram.sh",
890    filename_from_src: true,
891    compile_multilib: "both",
892}
893
894sh_test {
895    name: "kselftest_zram_zram01.sh",
896    sub_dir: "linux-kselftest/zram",
897    src: "tools/testing/selftests/zram/zram01.sh",
898    filename_from_src: true,
899    compile_multilib: "both",
900}
901
902sh_test {
903    name: "kselftest_zram_zram02.sh",
904    sub_dir: "linux-kselftest/zram",
905    src: "tools/testing/selftests/zram/zram02.sh",
906    filename_from_src: true,
907    compile_multilib: "both",
908}
909
910sh_test {
911    name: "kselftest_zram_zram_lib.sh",
912    sub_dir: "linux-kselftest/zram",
913    src: "tools/testing/selftests/zram/zram_lib.sh",
914    filename_from_src: true,
915    compile_multilib: "both",
916}
917