summaryrefslogtreecommitdiff
path: root/test/CodeGen/debug-info-block-decl.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commitbfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/CodeGen/debug-info-block-decl.c
parent6a0372513edbc473b538d2f724efac50405d6fef (diff)
Diffstat (limited to 'test/CodeGen/debug-info-block-decl.c')
-rw-r--r--test/CodeGen/debug-info-block-decl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/debug-info-block-decl.c b/test/CodeGen/debug-info-block-decl.c
new file mode 100644
index 000000000000..06c0e1ad3192
--- /dev/null
+++ b/test/CodeGen/debug-info-block-decl.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fblocks -emit-llvm -o - %s | FileCheck %s
+// Assignment and block entry should point to the same line.
+// rdar://problem/14039866
+
+// CHECK: define{{.*}}@main()
+// CHECK: store{{.*}}bitcast{{.*}}, !dbg ![[ASSIGNMENT:[0-9]+]]
+// CHECK: define {{.*}} @__main_block_invoke
+// CHECK: dbg ![[BLOCK_ENTRY:[0-9]+]]
+
+int main()
+{
+// CHECK: [[ASSIGNMENT]] = metadata !{i32 [[@LINE+2]],
+// CHECK: [[BLOCK_ENTRY]] = metadata !{i32 [[@LINE+1]],
+ int (^blockptr)(void) = ^(void) {
+ return 0;
+ };
+ return blockptr();
+}
+