]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testsanitizers: skip test for version of clang before 3.6
authorIan Lance Taylor <iant@golang.org>
Fri, 2 Oct 2015 14:04:34 +0000 (07:04 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 2 Oct 2015 14:17:33 +0000 (14:17 +0000)
I've tested with clang 3.6.  The builder is running 3.5, and fails.

Fixes #12814.

Change-Id: I087fb75c3a24bed7f7fa5e9d7a1444590a316d63
Reviewed-on: https://go-review.googlesource.com/15259
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/cgo/testsanitizers/test.bash

index 5ad303a0cc80258c2a03ccf7f9fe9548bb3a8b37..44cf529603ecf305f4a9cd2b77765cdee7290f21 100755 (executable)
@@ -17,6 +17,18 @@ export CC
 
 if $CC -fsanitize=memory 2>&1 | grep "unrecognized" >& /dev/null; then
   echo "skipping msan test: -fsanitize=memory not supported"
-else
-  go run msan.go
+  exit 0
 fi
+
+# The memory sanitizer in versions of clang before 3.6 don't work with Go.
+if $CC --version | grep clang >& /dev/null; then
+  ver=$($CC --version | sed -e 's/.* version \([0-9.-]*\).*/\1/')
+  major=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/')
+  minor=$(echo $ver | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/')
+  if test $major -lt 3 || test $major -eq 3 -a $minor -lt 6; then
+    echo "skipping msan test; clang version $major.$minor older than 3.6"
+    exit 0
+  fi
+fi
+
+go run msan.go