mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-04 18:49:41 +00:00

Overhaul the riscv vector tests to use kselftest_harness to help the test cases correctly report the results and decouple the individual test cases from each other. With this refactoring, only run the test cases if vector is reported and properly report the test case as skipped otherwise. The v_initval_nolibc test was previously not checking if vector was supported and used a function (malloc) which invalidates the state of the vector registers. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Tested-by: Yangyu Chen <cyy@cyyself.name> Link: https://lore.kernel.org/r/20241113-xtheadvector-v11-12-236c22791ef9@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
29 lines
1001 B
Makefile
29 lines
1001 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2021 ARM Limited
|
|
# Originally tools/testing/arm64/abi/Makefile
|
|
|
|
TEST_GEN_PROGS := v_initval vstate_prctl
|
|
TEST_GEN_PROGS_EXTENDED := vstate_exec_nolibc v_exec_initval_nolibc
|
|
|
|
include ../../lib.mk
|
|
|
|
$(OUTPUT)/sys_hwprobe.o: ../hwprobe/sys_hwprobe.S
|
|
$(CC) -static -c -o$@ $(CFLAGS) $^
|
|
|
|
$(OUTPUT)/v_helpers.o: v_helpers.c
|
|
$(CC) -static -c -o$@ $(CFLAGS) $^
|
|
|
|
$(OUTPUT)/vstate_prctl: vstate_prctl.c $(OUTPUT)/sys_hwprobe.o $(OUTPUT)/v_helpers.o
|
|
$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
|
|
|
|
$(OUTPUT)/vstate_exec_nolibc: vstate_exec_nolibc.c
|
|
$(CC) -nostdlib -static -include ../../../../include/nolibc/nolibc.h \
|
|
-Wall $(CFLAGS) $(LDFLAGS) $^ -o $@ -lgcc
|
|
|
|
$(OUTPUT)/v_initval: v_initval.c $(OUTPUT)/sys_hwprobe.o $(OUTPUT)/v_helpers.o
|
|
$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
|
|
|
|
$(OUTPUT)/v_exec_initval_nolibc: v_exec_initval_nolibc.c
|
|
$(CC) -nostdlib -static -include ../../../../include/nolibc/nolibc.h \
|
|
-Wall $(CFLAGS) $(LDFLAGS) $^ -o $@ -lgcc
|