aboutsummaryrefslogtreecommitdiff
path: root/debuginfo-tests
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-01-11 00:31:01 +0000
committerDevang Patel <dpatel@apple.com>2011-01-11 00:31:01 +0000
commit00c84fd1258cf78342c1b02f2e3537789f8defb7 (patch)
tree6c360b77d767d9e60f1e30e985c8452aa469809b /debuginfo-tests
parentbc474989730ba2183e4e2c974e15d605d61c370b (diff)
downloadllvm-00c84fd1258cf78342c1b02f2e3537789f8defb7.tar.gz
llvm-00c84fd1258cf78342c1b02f2e3537789f8defb7.tar.bz2
llvm-00c84fd1258cf78342c1b02f2e3537789f8defb7.zip
Test case for r123199.
llvm-svn: 123200
Diffstat (limited to 'debuginfo-tests')
-rw-r--r--debuginfo-tests/block_var.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/debuginfo-tests/block_var.m b/debuginfo-tests/block_var.m
new file mode 100644
index 000000000000..59b6a1432457
--- /dev/null
+++ b/debuginfo-tests/block_var.m
@@ -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);
+}
+
+