summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/gcdantipatternchecker_test.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/gcdantipatternchecker_test.m')
-rw-r--r--clang/test/Analysis/gcdantipatternchecker_test.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/gcdantipatternchecker_test.m b/clang/test/Analysis/gcdantipatternchecker_test.m
index adc7a52bf53..24ffe8975dd 100644
--- a/clang/test/Analysis/gcdantipatternchecker_test.m
+++ b/clang/test/Analysis/gcdantipatternchecker_test.m
@@ -333,3 +333,13 @@ void dispatch_group_and_semaphore_use(MyInterface1 *M) {
}];
dispatch_semaphore_wait(sema1, 100); // expected-warning{{Waiting on a callback using a semaphore}}
}
+
+void no_warn_on_nonzero_semaphore(MyInterface1 *M) {
+ dispatch_semaphore_t sema1 = dispatch_semaphore_create(1);
+
+ [M acceptBlock:^{
+ dispatch_semaphore_signal(sema1);
+ }];
+ dispatch_semaphore_wait(sema1, 100); // no-warning
+}
+
OpenPOWER on IntegriCloud