diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-12 02:17:52 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-12 02:17:52 +0000 |
commit | dd55b95fb2c2d3d65cf37c3cd8173380a97dd673 (patch) | |
tree | 3e3083e814672c88bd71ab5483adf5ab21909d30 /clang/test/Modules/thread-safety.cpp | |
parent | 9e5f2a96f1c2e0ba2456b86102d5f558bcfc01dc (diff) | |
download | bcm5719-llvm-dd55b95fb2c2d3d65cf37c3cd8173380a97dd673.tar.gz bcm5719-llvm-dd55b95fb2c2d3d65cf37c3cd8173380a97dd673.zip |
[modules] Fix thread safety analysis to cope with merging of FieldDecls across modules.
llvm-svn: 244714
Diffstat (limited to 'clang/test/Modules/thread-safety.cpp')
-rw-r--r-- | clang/test/Modules/thread-safety.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Modules/thread-safety.cpp b/clang/test/Modules/thread-safety.cpp new file mode 100644 index 00000000000..e6e85d284c8 --- /dev/null +++ b/clang/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); +} |