#!/bin/sh
# Check that the symlinks are correctly defined, by invoking the binaries:

set -e
rustc
rustdoc

# exit code 1 is normal for running rust-lld (compared to 127 for a command not found).
# stderr output is suppressed since it is also expected.
set +e
rust-lld 2>/dev/null
if [ $? -ne 1 ]; then
    exit 1
fi

# exit code 1 is normal for running rust-clang with no arguments:
# stderr output is suppressed since it is also expected.
rust-clang 2>/dev/null
if [ $? -ne 1 ]; then
    exit 1
fi

set -e
rust-llvm-dwp 2>/dev/null
