Skip to content

Commit

Permalink
[TSan][Darwin] Prevent inlining of functions in tests
Browse files Browse the repository at this point in the history
Prevent inlining of functions so we can FileCheck the generated stack
traces.
  • Loading branch information
Julian Lettner committed Dec 2, 2021
1 parent 8f329ce commit 863b117
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions compiler-rt/test/tsan/atexit4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static void race() {
}

struct X {
__attribute__((noinline))
X() { atexit(race); }
} x;

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/tsan/atexit5.cpp
Original file line number Diff line number Diff line change
@@ -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>

Expand Down

0 comments on commit 863b117

Please sign in to comment.