]> granicus.if.org Git - clang/commitdiff
Add codegen support for aggregate BlockDeclRefExprs.
authorMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 15:54:29 +0000 (15:54 +0000)
committerMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 15:54:29 +0000 (15:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67207 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprAgg.cpp
test/CodeGen/blocks-1.c

index b3d9cb68432f1a9199b2b08ba1f25307b8190e56..ff107f9da4ef2b4ffc1869704b94640c483a181c 100644 (file)
@@ -72,6 +72,9 @@ public:
     EmitAggLoadOfLValue(E);
   }
   
+  void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E)
+      { EmitAggLoadOfLValue(E); }
+
   // Operators.
   //  case Expr::UnaryOperatorClass:
   //  case Expr::CastExprClass: 
index 8572f8d6cf85d93996d63b2db90a6a3fc781b257..ae63e73a18e124cbbd937eb02cae3e928759f7ab 100644 (file)
@@ -1,11 +1,11 @@
 // RUN: clang %s -emit-llvm -o %t -fblocks -f__block &&
-// RUN: grep "_Block_object_dispose" %t | count 10 &&
-// RUN: grep "__copy_helper_block_" %t | count 6 &&
-// RUN: grep "__destroy_helper_block_" %t | count 6 &&
+// RUN: grep "_Block_object_dispose" %t | count 12 &&
+// RUN: grep "__copy_helper_block_" %t | count 8 &&
+// RUN: grep "__destroy_helper_block_" %t | count 8 &&
 // 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 2 &&
-// RUN: grep "_Block_object_assign" %t | count 6
+// RUN: grep "_Block_object_assign" %t | count 7
 
 #include <stdio.h>
 
@@ -50,11 +50,17 @@ int test4() {
 
 int g;
 
+void test5() {
+  __block struct { int i; } i;
+  ^{ (void)i; }();
+}
+
 int main() {
   int rv = 0;
   test1();
   test2();
   test3();
   rv += test4();
+  test5();
   return rv;
 }