misc/cgo/testsanitizers: fix check for existence of clang

The current mechanism fails if clang cannot be executed by the current
user.  Using the `-x` operator for `test` return TRUE if the file is
executable by the user.

Change-Id: I0f3c8dc3880c1ce5a8a833ff3109eb96853184af
Reviewed-on: https://go-review.googlesource.com/16752
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Mohit Agarwal 2015-11-10 01:52:52 +05:30 committed by Ian Lance Taylor
parent 6c967c0ad2
commit 8e848ba653

View File

@ -10,7 +10,7 @@ set -e
# The sanitizers were originally developed with clang, so prefer it.
CC=cc
if test "$(type -p clang)" != ""; then
if test -x "$(type -p clang)"; then
CC=clang
fi
export CC