xref: /aosp_15_r20/external/clang/test/Modules/thread-safety.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: rm -rf %t
2*67e74705SXin Li // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps \
3*67e74705SXin Li // RUN:            -I%S/Inputs/thread-safety -std=c++11 -Wthread-safety \
4*67e74705SXin Li // RUN:            -verify %s
5*67e74705SXin Li //
6*67e74705SXin Li // expected-no-diagnostics
7*67e74705SXin Li 
8*67e74705SXin Li #include "b.h"
9*67e74705SXin Li #include "c.h"
10*67e74705SXin Li 
11*67e74705SXin Li bool g();
f()12*67e74705SXin Li void X::f() {
13*67e74705SXin Li   m.lock();
14*67e74705SXin Li   if (g())
15*67e74705SXin Li     m.unlock();
16*67e74705SXin Li   else
17*67e74705SXin Li     unlock(*this);
18*67e74705SXin Li }
19