1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.unix.PthreadLock,debug.ExprInspection 2>&1 %s | FileCheck %s
3 #include "Inputs/system-header-simulator-for-pthread-lock.h"
7 void clang_analyzer_printState(void);
9 void test(pthread_mutex_t
*mtx
) {
10 int ret
= pthread_mutex_destroy(mtx
);
11 clang_analyzer_printState();
12 // CHECK: { "checker": "alpha.core.PthreadLockBase", "messages": [
13 // CHECK-NEXT: "Mutex states:",
14 // CHECK-NEXT: "SymRegion{reg_$[[REG:[0-9]+]]<pthread_mutex_t * mtx>}: not tracked, possibly destroyed",
15 // CHECK-NEXT: "Mutexes in unresolved possibly destroyed state:",
16 // CHECK-NEXT: "SymRegion{reg_$[[REG]]<pthread_mutex_t * mtx>}: conj_$
21 pthread_mutex_init(mtx
, NULL
);