hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/testing/selftests/x86/check_cc.sh
....@@ -1,13 +1,13 @@
11 #!/bin/sh
2
+# SPDX-License-Identifier: GPL-2.0-only
23 # check_cc.sh - Helper to test userspace compilation support
34 # Copyright (c) 2015 Andrew Lutomirski
4
-# GPL v2
55
66 CC="$1"
77 TESTPROG="$2"
88 shift 2
99
10
-if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
10
+if [ -n "$CC" ] && $CC -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
1111 echo 1
1212 else
1313 echo 0