[TSan][Darwin] Prevent inlining of functions in tests
authorJulian Lettner <julian.lettner@apple.com>
Thu, 2 Dec 2021 00:58:36 +0000 (16:58 -0800)
committerJulian Lettner <julian.lettner@apple.com>
Thu, 2 Dec 2021 01:00:52 +0000 (17:00 -0800)
Prevent inlining of functions so we can FileCheck the generated stack
traces.

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

index 7102b3a..6126e8c 100644 (file)
@@ -17,6 +17,7 @@ static void race() {
 }
 
 struct X {
+  __attribute__((noinline))
   X() { atexit(race); }
 } x;
 
index ef3b385..e24f15d 100644 (file)
@@ -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>