diff options
Diffstat (limited to 'test/Modules/thread-safety.cpp')
-rw-r--r-- | test/Modules/thread-safety.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Modules/thread-safety.cpp b/test/Modules/thread-safety.cpp new file mode 100644 index 0000000..e6e85d2 --- /dev/null +++ b/test/Modules/thread-safety.cpp @@ -0,0 +1,18 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps \ +// RUN: -I%S/Inputs/thread-safety -std=c++11 -Wthread-safety \ +// RUN: -verify %s +// +// expected-no-diagnostics + +#include "b.h" +#include "c.h" + +bool g(); +void X::f() { + m.lock(); + if (g()) + m.unlock(); + else + unlock(*this); +} |