Fixup codegen for write barriers for block variables.  Radar 6786715


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69642 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenObjC/blocks-1.m b/test/CodeGenObjC/blocks-1.m
index e343a58..2b4f8fa 100644
--- a/test/CodeGenObjC/blocks-1.m
+++ b/test/CodeGenObjC/blocks-1.m
@@ -1,13 +1,13 @@
 // RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks -triple i386-apple-darwin10 &&
-// RUN: grep "_Block_object_dispose" %t | count 4 &&
-// RUN: grep "__copy_helper_block_" %t | count 2 &&
-// RUN: grep "__destroy_helper_block_" %t | count 2 &&
+// RUN: grep "_Block_object_dispose" %t | count 6 &&
+// RUN: grep "__copy_helper_block_" %t | count 4 &&
+// RUN: grep "__destroy_helper_block_" %t | count 4 &&
 // RUN: grep "__Block_byref_id_object_copy_" %t | count 2 &&
 // RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 &&
 // RUN: grep "i32 135)" %t | count 0 &&
-// RUN: grep "_Block_object_assign" %t | count 3 &&
+// RUN: grep "_Block_object_assign" %t | count 4 &&
 // RUN: grep "objc_read_weak" %t | count 2 &&
-// RUN: grep "objc_assign_weak" %t | count 2
+// RUN: grep "objc_assign_weak" %t | count 3
 
 @interface NSDictionary @end
 
@@ -24,3 +24,10 @@
   l = weakSelf;
   weakSelf = l;
 }
+
+void (^__weak b)(void);
+
+void test2() {
+  __block int i = 0;
+  b = ^ {  ++i; };
+}