aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/x86/check_cc.sh
blob: 3e2089c8cf54967fdd375ec151a15827e104fc53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# check_cc.sh - Helper to test userspace compilation support
# Copyright (c) 2015 Andrew Lutomirski

CC="$1"
TESTPROG="$2"
shift 2

if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
    echo 1
else
    echo 0
fi

exit 0