File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -294,19 +294,13 @@ void testBlockInCriticalSectionUniqueLockNested() {
294294 sleep (1 ); // no-warning
295295}
296296
297- void testTrylockCurrentlyFalsePositive (pthread_mutex_t *m) {
298- // expected-note@+4 {{Assuming the condition is true}}
299- // expected-note@+3 {{Taking true branch}}
300- // expected-note@+2 {{Assuming the condition is false}}
301- // expected-note@+1 {{Taking false branch}}
302- if (pthread_mutex_trylock (m) == 0 ) { // expected-note 2 {{Entering critical section here}}
303- // FIXME: we are entering the critical section only in the true branch
297+ void testTrylockStateSplitting (pthread_mutex_t *m) {
298+ // expected-note@+1 {{Taking true branch}}
299+ if (pthread_mutex_trylock (m) == 0 ) { // expected-note {{Entering critical section here}}
304300 sleep (10 ); // expected-warning {{Call to blocking function 'sleep' inside of critical section}}
305301 // expected-note@-1 {{Call to blocking function 'sleep' inside of critical section}}
306302 pthread_mutex_unlock (m);
307303 } else {
308- sleep (10 ); // expected-warning {{Call to blocking function 'sleep' inside of critical section}}
309- // expected-note@-1 {{Call to blocking function 'sleep' inside of critical section}}
310- // FIXME: this is a false positive, the lock was not acquired
304+ sleep (10 ); // no-warning
311305 }
312306}
You can’t perform that action at this time.
0 commit comments