1e9886aceSAndy Lutomirski#!/bin/sh
2fb9e53ccSThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
3e9886aceSAndy Lutomirski# check_cc.sh - Helper to test userspace compilation support
4e9886aceSAndy Lutomirski# Copyright (c) 2015 Andrew Lutomirski
5e9886aceSAndy Lutomirski
6e9886aceSAndy LutomirskiCC="$1"
7e9886aceSAndy LutomirskiTESTPROG="$2"
8e9886aceSAndy Lutomirskishift 2
9e9886aceSAndy Lutomirski
10e9886aceSAndy Lutomirskiif "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
11e9886aceSAndy Lutomirski    echo 1
12e9886aceSAndy Lutomirskielse
13e9886aceSAndy Lutomirski    echo 0
14e9886aceSAndy Lutomirskifi
15e9886aceSAndy Lutomirski
16e9886aceSAndy Lutomirskiexit 0
17