1 // RUN: %clang_cc1 -analyze -analyzer-checker=alpha.unix.BlockInCriticalSection -std=c++11 -verify %s
12 void testBlockInCriticalSection() {
15 sleep(3); // expected-warning {{A blocking function %s is called inside a critical section}}
19 void testBlockInCriticalSectionWithNestedMutexes() {
24 sleep(3); // expected-warning {{A blocking function %s is called inside a critical section}}
26 sleep(5); // expected-warning {{A blocking function %s is called inside a critical section}}
28 sleep(3); // expected-warning {{A blocking function %s is called inside a critical section}}
30 sleep(3); // no-warning
34 sleep(1000); // expected-warning {{A blocking function %s is called inside a critical section}}
37 void testBlockInCriticalSectionInterProcedural() {
44 void testBlockInCriticalSectionUnexpectedUnlock() {
47 sleep(1); // no-warning
49 sleep(1); // expected-warning {{A blocking function %s is called inside a critical section}}