aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-09-27 14:57:18 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-10-17 12:38:56 +0200
commit27969c4e00bb3fcfc8cc149864e1b1f7e87a6753 (patch)
tree63dd7e267f7e82f9b38e7babe201048b5ed701a0 /clang/lib/CodeGen/CodeGenModule.cpp
parent1d7aadb4c48a696a8501126357295fdcc3c98380 (diff)
downloadllvm-27969c4e00bb3fcfc8cc149864e1b1f7e87a6753.zip
llvm-27969c4e00bb3fcfc8cc149864e1b1f7e87a6753.tar.gz
llvm-27969c4e00bb3fcfc8cc149864e1b1f7e87a6753.tar.bz2
tsan: refactor trace tests
Instead of creating real threads for trace tests create a new ThreadState in the main thread. This makes the tests more unit-testy and will also help with future trace tests that will need more than 1 thread. Creating more than 1 real thread and dispatching test actions across multiple threads in the required deterministic order is painful. This is resubmit of reverted D110546 with 2 changes: 1. The previous version patched ImitateTlsWrite to not expect ThreadState to be allocated in TLS (the CHECK failed for the fake test threads). This added an ugly hack into production code and was still logically wrong because we imitated write to the main thread TLS/stack when we started the fake test thread (which has nothing to do with the main thread TLS/stack). This version uses ThreadType::Fiber instead of ThreadType::Regular for the fake threads. This naturally makes ThreadStart skip obtaining stack/tls and imitating writes to them. 2. This version still skips the tests on Darwin and PowerPC to be on the safer side. Build bots reported failures for PowerPC for the previous version. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D111156
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions