ThreadSanitizer outputs ANSI color codes by default, which causes output
pattern tests to fail. This adds 'setenv TSAN_OPTIONS "color=never"' in
tsan_init(), matching the behavior of ASAN and UBSAN test libraries.

Fixes output pattern test failures like:
  FAIL: c-c++-common/tsan/atomic_stack.c -O2 output pattern test

gcc/testsuite/ChangeLog:

        * lib/tsan-dg.exp (tsan_init): Set TSAN_OPTIONS to disable
        color output, matching ASAN and UBSAN behavior.

Signed-off-by: Jerry Zhang Jian <[email protected]>
---
 gcc/testsuite/lib/tsan-dg.exp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp
index 4d7026ea126..83a3150bcb7 100644
--- a/gcc/testsuite/lib/tsan-dg.exp
+++ b/gcc/testsuite/lib/tsan-dg.exp
@@ -93,6 +93,7 @@ proc tsan_init { args } {
     global tsan_saved_ALWAYS_CXXFLAGS
     global dg-do-what-default
     global tsan_saved_dg-do-what-default
+    setenv TSAN_OPTIONS "color=never"
 
     set link_flags ""
     if ![is_remote host] {
-- 
2.51.0

Reply via email to