1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
4 // Test that a linker-initialized mutex can be created/destroyed while in use.
6 // Stub for testing, just invokes annotations.
7 // Meant to be synchronized externally with test barrier.
10 void Create(bool linker_initialized
= false) {
11 if (linker_initialized
)
12 ANNOTATE_RWLOCK_CREATE_STATIC(&state_
);
14 ANNOTATE_RWLOCK_CREATE(&state_
);
18 ANNOTATE_RWLOCK_DESTROY(&state_
);
22 ANNOTATE_RWLOCK_ACQUIRED(&state_
, true);
26 ANNOTATE_RWLOCK_RELEASED(&state_
, true);
44 fprintf(stderr
, "DONE\n");
48 // CHECK-NOT: WARNING: ThreadSanitizer: