summaryrefslogtreecommitdiff
path: root/test/SemaObjC
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC')
-rw-r--r--test/SemaObjC/blocks.m12
-rw-r--r--test/SemaObjC/exprs.m5
2 files changed, 16 insertions, 1 deletions
diff --git a/test/SemaObjC/blocks.m b/test/SemaObjC/blocks.m
index 36292309732b..ddac7d1759ec 100644
--- a/test/SemaObjC/blocks.m
+++ b/test/SemaObjC/blocks.m
@@ -55,3 +55,15 @@ int foo9() {
}
}
+
+// rdar 7725203
+@class NSString;
+
+extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+
+void foo10() {
+ void(^myBlock)(void) = ^{
+ };
+ NSLog(@"%@", myBlock);
+}
+
diff --git a/test/SemaObjC/exprs.m b/test/SemaObjC/exprs.m
index 33b144461f2b..3370bda0517a 100644
--- a/test/SemaObjC/exprs.m
+++ b/test/SemaObjC/exprs.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wno-unreachable-code
+// RUN: %clang_cc1 %s -fsyntax-only -fblocks -verify -Wno-unreachable-code
// rdar://6597252
Class test1(Class X) {
@@ -19,3 +19,6 @@ void test2() {
if (@encode(int) == "foo") { } // expected-warning {{result of comparison against @encode is unspecified}}
}
+
+#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
+void (^foo)(int, int) = ^(int x, int y) { int z = MAX(x, y); };