[llvm-commits] [debuginfo-tests] r123200 - /debuginfo-tests/trunk/block_var.m

Devang Patel dpatel at apple.com
Mon Jan 10 16:31:01 PST 2011


Author: dpatel
Date: Mon Jan 10 18:31:01 2011
New Revision: 123200

URL: http://llvm.org/viewvc/llvm-project?rev=123200&view=rev
Log:
Test case for r123199.

Added:
    debuginfo-tests/trunk/block_var.m

Added: debuginfo-tests/trunk/block_var.m
URL: http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/block_var.m?rev=123200&view=auto
==============================================================================
--- debuginfo-tests/trunk/block_var.m (added)
+++ debuginfo-tests/trunk/block_var.m Mon Jan 10 18:31:01 2011
@@ -0,0 +1,30 @@
+// RUN: %clang -O0 -g %s -c -o %t.o
+// RUN: %clang %t.o -o %t.out -framework Foundation
+// RUN: %test_debuginfo %s %t.out 
+
+// DEBUGGER: break 22
+// DEBUGGER: r
+// DEBUGGER: p result
+// CHECK: $1 = 42
+
+void doBlock(void (^block)(void))
+{
+    block();
+}
+
+int I(int n)
+{
+    __block int result;
+    int i = 2;
+    doBlock(^{
+        result = n;
+    });
+    return result + i; /* Check value of 'result' */
+}
+
+
+int main (int argc, const char * argv[]) {
+  return I(42);
+}
+
+





More information about the llvm-commits mailing list