summaryrefslogtreecommitdiff
path: root/test/Analysis/blocks.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/blocks.m')
-rw-r--r--test/Analysis/blocks.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m
index 0b1c15abb3b3e..bf10c61d3a214 100644
--- a/test/Analysis/blocks.m
+++ b/test/Analysis/blocks.m
@@ -232,3 +232,12 @@ __attribute__((objc_root_class))
});
}
@end
+
+// The incorrect block variable initialization below is a hard compile-time
+// error in C++.
+#if !defined(__cplusplus)
+void call_block_with_fewer_arguments() {
+ void (^b)() = ^(int a) { };
+ b(); // expected-warning {{Block taking 1 argument is called with fewer (0)}}
+}
+#endif