The sanitizer unit tests fail on FreeBSD because __cxa_demangle returns invalid demanglings when dealing with non-C++ mangled names. It is not guaranteed to return the same string back. If the input string is not a C++ mangling, don't try to demangle it.
Reid Kleckner <rnk@google.com>:
"
This test is failing on FreeBSD, it appears because __cxa_demangle consumes the leading 'f' of foo and returns "float":
http://lab.llvm.org:8011/builders/sanitizer_x86_64-freebsd/builds/12709/steps/test%20sanitizer/logs/stdio
FAIL: SanitizerCommon-Unit :: Sanitizer-x86_64-Test/Symbolizer.DemangleSwiftAndCXX (292 of 309)
- TEST 'SanitizerCommon-Unit :: Sanitizer-x86_64-Test/Symbolizer.DemangleSwiftAndCXX' FAILED ****
Note: Google Test filter = Symbolizer.DemangleSwiftAndCXX
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Symbolizer
[ RUN ] Symbolizer.DemangleSwiftAndCXX
/usr/home/buildslave/slave_as-bldslv5/sanitizer_x86_64-freebsd/llvm.src/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc:65: Failure
Value of: DemangleSwiftAndCXX("foo")
Actual: "float"
Expected: "foo"
[ FAILED ] Symbolizer.DemangleSwiftAndCXX (3 ms)
[----------] 1 test from Symbolizer (3 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (7 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Symbolizer.DemangleSwiftAndCXX
1 FAILED TEST
"