[TSan][Darwin] Prevent inlining of functions in tests
Prevent inlining of functions so we can FileCheck the generated stack
traces.
GitOrigin-RevId: 863b117411d898f5a288f560c48d75bb145d39f6
diff --git a/test/tsan/atexit4.cpp b/test/tsan/atexit4.cpp
index 7102b3a..6126e8c 100644
--- a/test/tsan/atexit4.cpp
+++ b/test/tsan/atexit4.cpp
@@ -17,6 +17,7 @@
}
struct X {
+ __attribute__((noinline))
X() { atexit(race); }
} x;
diff --git a/test/tsan/atexit5.cpp b/test/tsan/atexit5.cpp
index ef3b385..e24f15d 100644
--- a/test/tsan/atexit5.cpp
+++ b/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>