[compiler-rt] 6beb6f3 - dfsan: Fix test with gcc 15.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 14:44:51 PDT 2025


Author: Peter Collingbourne
Date: 2025-08-15T14:44:27-07:00
New Revision: 6beb6f34bc8e9ae34e6a4dcc36e24b765e7f2b47

URL: https://github.com/llvm/llvm-project/commit/6beb6f34bc8e9ae34e6a4dcc36e24b765e7f2b47
DIFF: https://github.com/llvm/llvm-project/commit/6beb6f34bc8e9ae34e6a4dcc36e24b765e7f2b47.diff

LOG: dfsan: Fix test with gcc 15.

With gcc 15 we end up emitting a reference to the
std::__glibcxx_assert_fail function because of this change:
https://github.com/gcc-mirror/gcc/commit/361d230fd7800a7e749aba8ed020f54f5c26d504
combined with assertion checks in the std::atomic implementation.

This reference is undefined with dfsan causing the test to fail. Fix it
by defining the macro that disables assertions.

Pull Request: https://github.com/llvm/llvm-project/pull/153873

Added: 
    

Modified: 
    compiler-rt/test/dfsan/atomic.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/dfsan/atomic.cpp b/compiler-rt/test/dfsan/atomic.cpp
index 22ee323c752f8..73e1cbd17a7cd 100644
--- a/compiler-rt/test/dfsan/atomic.cpp
+++ b/compiler-rt/test/dfsan/atomic.cpp
@@ -1,9 +1,12 @@
-// RUN: %clangxx_dfsan %s -fno-exceptions -o %t && %run %t
-// RUN: %clangxx_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -o %t && %run %t
+// RUN: %clangxx_dfsan %s -fno-exceptions -D_GLIBCXX_NO_ASSERTIONS -o %t && %run %t
+// RUN: %clangxx_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -D_GLIBCXX_NO_ASSERTIONS -o %t && %run %t
 //
 // Use -fno-exceptions to turn off exceptions to avoid instrumenting
 // __cxa_begin_catch, std::terminate and __gxx_personality_v0.
 //
+// Use -D_GLIBCXX_NO_ASSERTIONS to avoid depending on
+// std::__glibcxx_assert_fail with gcc >= 15.
+//
 // TODO: Support builtin atomics. For example, https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
 // DFSan instrumentation pass cannot identify builtin callsites yet.
 


        


More information about the llvm-commits mailing list