From: Mohit Agarwal Date: Mon, 9 Nov 2015 20:22:52 +0000 (+0530) Subject: misc/cgo/testsanitizers: fix check for existence of clang X-Git-Tag: go1.6beta1~575 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e848ba65310eb0417a01907a3ac39fdc84782ab;p=gostls13.git 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 --- diff --git a/misc/cgo/testsanitizers/test.bash b/misc/cgo/testsanitizers/test.bash index 19407b8cb2..e200bcb80b 100755 --- a/misc/cgo/testsanitizers/test.bash +++ b/misc/cgo/testsanitizers/test.bash @@ -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