summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/llgdb-tests/block_var.m
diff options
context:
space:
mode:
Diffstat (limited to 'debuginfo-tests/llgdb-tests/block_var.m')
-rw-r--r--debuginfo-tests/llgdb-tests/block_var.m32
1 files changed, 32 insertions, 0 deletions
diff --git a/debuginfo-tests/llgdb-tests/block_var.m b/debuginfo-tests/llgdb-tests/block_var.m
new file mode 100644
index 00000000000..7ec786f1798
--- /dev/null
+++ b/debuginfo-tests/llgdb-tests/block_var.m
@@ -0,0 +1,32 @@
+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
+// RUN: %test_debuginfo %s %t.out
+
+// REQUIRES: system-darwin
+
+// DEBUGGER: break 24
+// DEBUGGER: r
+// DEBUGGER: p result
+// CHECK: ${{[0-9]}} = 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);
+}
+
+
OpenPOWER on IntegriCloud