Skip to content

Commit f80ff56

Browse files
misc/cgo/testsanitizers: skip test for version of clang before 3.6
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 <[email protected]>
1 parent 47ccf96 commit f80ff56

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

misc/cgo/testsanitizers/test.bash

+14-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ export CC
1717

1818
if $CC -fsanitize=memory 2>&1 | grep "unrecognized" >& /dev/null; then
1919
echo "skipping msan test: -fsanitize=memory not supported"
20-
else
21-
go run msan.go
20+
exit 0
2221
fi
22+
23+
# The memory sanitizer in versions of clang before 3.6 don't work with Go.
24+
if $CC --version | grep clang >& /dev/null; then
25+
ver=$($CC --version | sed -e 's/.* version \([0-9.-]*\).*/\1/')
26+
major=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/')
27+
minor=$(echo $ver | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/')
28+
if test $major -lt 3 || test $major -eq 3 -a $minor -lt 6; then
29+
echo "skipping msan test; clang version $major.$minor older than 3.6"
30+
exit 0
31+
fi
32+
fi
33+
34+
go run msan.go

0 commit comments

Comments
 (0)