xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/debug-info-block-decl.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fblocks -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc // Assignment and block entry should point to the same line.
3*f4a2713aSLionel Sambuc // rdar://problem/14039866
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc // CHECK: define{{.*}}@main()
6*f4a2713aSLionel Sambuc // CHECK: store{{.*}}bitcast{{.*}}, !dbg ![[ASSIGNMENT:[0-9]+]]
7*f4a2713aSLionel Sambuc // CHECK: define {{.*}} @__main_block_invoke
8*f4a2713aSLionel Sambuc // CHECK: dbg ![[BLOCK_ENTRY:[0-9]+]]
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc int main()
11*f4a2713aSLionel Sambuc {
12*f4a2713aSLionel Sambuc // CHECK: [[ASSIGNMENT]] = metadata !{i32 [[@LINE+2]],
13*f4a2713aSLionel Sambuc // CHECK: [[BLOCK_ENTRY]] = metadata !{i32 [[@LINE+1]],
14*f4a2713aSLionel Sambuc     int (^blockptr)(void) = ^(void) {
15*f4a2713aSLionel Sambuc       return 0;
16*f4a2713aSLionel Sambuc     };
17*f4a2713aSLionel Sambuc     return blockptr();
18*f4a2713aSLionel Sambuc }
19*f4a2713aSLionel Sambuc 
20