aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/dispatch-once.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/dispatch-once.m')
-rw-r--r--test/Analysis/dispatch-once.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Analysis/dispatch-once.m b/test/Analysis/dispatch-once.m
index 7d54147aebe2..2f82718663e5 100644
--- a/test/Analysis/dispatch-once.m
+++ b/test/Analysis/dispatch-once.m
@@ -107,3 +107,10 @@ void test_block_var_from_outside_block() {
};
dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the block variable 'once' for the predicate value.}}
}
+
+void test_static_var_from_outside_block() {
+ static dispatch_once_t once;
+ ^{
+ dispatch_once(&once, ^{}); // no-warning
+ };
+}