]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testsanitizers: fix check for existence of clang
authorMohit Agarwal <mohit@sdf.org>
Mon, 9 Nov 2015 20:22:52 +0000 (01:52 +0530)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Nov 2015 03:58:52 +0000 (03:58 +0000)
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>
misc/cgo/testsanitizers/test.bash

index 19407b8cb288d7e87a27cef82054630e146278b3..e200bcb80b451e8098b55742ba60a28e507f1ac3 100755 (executable)
@@ -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