aboutsummaryrefslogtreecommitdiff
path: root/test/Modules/thread-safety.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:49:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:49:41 +0000
commit45b533945f0851ec234ca846e1af5ee1e4df0b6e (patch)
tree0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/Modules/thread-safety.cpp
parent7e86edd64bfae4e324224452e4ea879b3371a4bd (diff)
Vendor import of clang trunk r256633:vendor/clang/clang-trunk-r256633
Diffstat (limited to 'test/Modules/thread-safety.cpp')
-rw-r--r--test/Modules/thread-safety.cpp18
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 000000000000..e6e85d284c82
--- /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);
+}