[compiler-rt] 863b117 - [TSan][Darwin] Prevent inlining of functions in tests

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 17:04:51 PST 2021


Author: Julian Lettner
Date: 2021-12-01T17:00:52-08:00
New Revision: 863b117411d898f5a288f560c48d75bb145d39f6

URL: https://github.com/llvm/llvm-project/commit/863b117411d898f5a288f560c48d75bb145d39f6
DIFF: https://github.com/llvm/llvm-project/commit/863b117411d898f5a288f560c48d75bb145d39f6.diff

LOG: [TSan][Darwin] Prevent inlining of functions in tests

Prevent inlining of functions so we can FileCheck the generated stack
traces.

Added: 
    

Modified: 
    compiler-rt/test/tsan/atexit4.cpp
    compiler-rt/test/tsan/atexit5.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/tsan/atexit4.cpp b/compiler-rt/test/tsan/atexit4.cpp
index 7102b3a43213c..6126e8c1622e1 100644
--- a/compiler-rt/test/tsan/atexit4.cpp
+++ b/compiler-rt/test/tsan/atexit4.cpp
@@ -17,6 +17,7 @@ static void race() {
 }
 
 struct X {
+  __attribute__((noinline))
   X() { atexit(race); }
 } x;
 

diff  --git a/compiler-rt/test/tsan/atexit5.cpp b/compiler-rt/test/tsan/atexit5.cpp
index ef3b3858251e4..e24f15d597ca1 100644
--- a/compiler-rt/test/tsan/atexit5.cpp
+++ b/compiler-rt/test/tsan/atexit5.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+// RUN: %clangxx_tsan -O1 -fno-inline-functions %s -o %t && %deflake %run %t | FileCheck %s
 #include "test.h"
 #include <memory>
 


        


More information about the llvm-commits mailing list