Skip to content

Commit 22ba81c

Browse files
committed
selftests/nolibc: run-tests.sh: allow building through LLVM
The nolibc tests can now be properly built with LLVM. Expose this through run-tests.sh. Reviewed-by: Shuah Khan <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 8404af7 commit 22ba81c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/testing/selftests/nolibc/run-tests.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ build_location="$(realpath "${cache_dir}"/nolibc-tests/)"
1616
perform_download=0
1717
test_mode=system
1818
werror=1
19+
llvm=
1920
archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch"
2021

21-
TEMP=$(getopt -o 'j:d:c:b:a:m:peh' -n "$0" -- "$@")
22+
TEMP=$(getopt -o 'j:d:c:b:a:m:pelh' -n "$0" -- "$@")
2223

2324
eval set -- "$TEMP"
2425
unset TEMP
@@ -42,6 +43,7 @@ Options:
4243
-b [DIR] Build location (default: ${build_location})
4344
-m [MODE] Test mode user/system (default: ${test_mode})
4445
-e Disable -Werror
46+
-l Build with LLVM/clang
4547
EOF
4648
}
4749

@@ -71,6 +73,9 @@ while true; do
7173
'-e')
7274
werror=0
7375
shift; continue ;;
76+
'-l')
77+
llvm=1
78+
shift; continue ;;
7479
'-h')
7580
print_usage
7681
exit 0
@@ -143,7 +148,7 @@ test_arch() {
143148
if [ "$werror" -ne 0 ]; then
144149
CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror"
145150
fi
146-
MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" O="${build_dir}")
151+
MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" LLVM="${llvm}" O="${build_dir}")
147152

148153
mkdir -p "$build_dir"
149154
if [ "$test_mode" = "system" ] && [ ! -f "${build_dir}/.config" ]; then

0 commit comments

Comments
 (0)