]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/DebugInfo/X86/dbg-value-inlined-parameter.ll
IR: Move MDLocation into place
[opencl/llvm.git] / test / DebugInfo / X86 / dbg-value-inlined-parameter.ll
1 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj \
2 ; RUN:     | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
3 ; RUN: llc -mtriple=x86_64-linux-gnu < %s -filetype=obj \
4 ; RUN:     | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=LINUX %s
5 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj -regalloc=basic \
6 ; RUN:     | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
8 ; CHECK: DW_TAG_subprogram
9 ; CHECK:   DW_AT_abstract_origin {{.*}} "foo"
10 ; CHECK:   DW_TAG_formal_parameter
11 ; CHECK-NOT: DW_TAG
12 ; CHECK:     DW_AT_abstract_origin {{.*}} "sp"
13 ; CHECK:   DW_TAG_formal_parameter
14 ; CHECK-NOT: DW_TAG
15 ; CHECK:     DW_AT_abstract_origin {{.*}} "nums"
17 ; CHECK: DW_TAG_subprogram
18 ; CHECK-NOT: DW_TAG
19 ; CHECK:   DW_AT_name {{.*}} "foo"
20 ; CHECK:   DW_TAG_formal_parameter
21 ; CHECK-NOT: DW_TAG
22 ; CHECK:     DW_AT_name {{.*}} "sp"
23 ; CHECK:   DW_TAG_formal_parameter
24 ; CHECK-NOT: DW_TAG
25 ; CHECK:     DW_AT_name {{.*}} "nums"
27 ;CHECK: DW_TAG_inlined_subroutine
28 ;CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo"
29 ;CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
30 ;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
31 ;CHECK-NEXT: DW_AT_call_file
32 ;CHECK-NEXT: DW_AT_call_line
34 ;CHECK: DW_TAG_formal_parameter
35 ;FIXME: Linux shouldn't drop this parameter either...
36 ;CHECK-NOT: DW_TAG
37 ;DARWIN:   DW_AT_abstract_origin {{.*}} "sp"
38 ;DARWIN: DW_TAG_formal_parameter
39 ;CHECK: DW_AT_abstract_origin {{.*}} "nums"
40 ;CHECK-NOT: DW_TAG_formal_parameter
42 %struct.S1 = type { float*, i32 }
44 @p = common global %struct.S1 zeroinitializer, align 8
46 define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp {
47 entry:
48   tail call void @llvm.dbg.value(metadata %struct.S1* %sp, i64 0, metadata !9, metadata !{!"0x102"}), !dbg !20
49   tail call void @llvm.dbg.value(metadata i32 %nums, i64 0, metadata !18, metadata !{!"0x102"}), !dbg !21
50   %tmp2 = getelementptr inbounds %struct.S1* %sp, i64 0, i32 1, !dbg !22
51   store i32 %nums, i32* %tmp2, align 4, !dbg !22
52   %call = tail call float* @bar(i32 %nums) nounwind optsize, !dbg !27
53   %tmp5 = getelementptr inbounds %struct.S1* %sp, i64 0, i32 0, !dbg !27
54   store float* %call, float** %tmp5, align 8, !dbg !27
55   %cmp = icmp ne float* %call, null, !dbg !29
56   %cond = zext i1 %cmp to i32, !dbg !29
57   ret i32 %cond, !dbg !29
58 }
60 declare float* @bar(i32) optsize
62 define void @foobar() nounwind optsize ssp {
63 entry:
64   tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !9, metadata !{!"0x102"}) nounwind, !dbg !31
65   tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !18, metadata !{!"0x102"}) nounwind, !dbg !35
66   store i32 1, i32* getelementptr inbounds (%struct.S1* @p, i64 0, i32 1), align 8, !dbg !36
67   %call.i = tail call float* @bar(i32 1) nounwind optsize, !dbg !37
68   store float* %call.i, float** getelementptr inbounds (%struct.S1* @p, i64 0, i32 0), align 8, !dbg !37
69   ret void, !dbg !38
70 }
72 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
74 !llvm.dbg.cu = !{!2}
75 !llvm.module.flags = !{!43}
77 !0 = !{!"0x2e\00foo\00foo\00\008\000\001\000\006\00256\001\008", !1, !1, !3, null, i32 (%struct.S1*, i32)* @foo, null, null, !41} ; [ DW_TAG_subprogram ] [line 8] [def] [foo]
78 !1 = !{!"0x29", !42} ; [ DW_TAG_file_type ]
79 !2 = !{!"0x11\0012\00clang version 2.9 (trunk 125693)\001\00\000\00\001", !42, !8, !8, !39, !40,  !44} ; [ DW_TAG_compile_unit ]
80 !3 = !{!"0x15\00\000\000\000\000\000\000", !42, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
81 !4 = !{!5}
82 !5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ]
83 !6 = !{!"0x2e\00foobar\00foobar\00\0015\000\001\000\006\000\001\000", !1, !1, !7, null, void ()* @foobar, null, null, null} ; [ DW_TAG_subprogram ] [line 15] [def] [scope 0] [foobar]
84 !7 = !{!"0x15\00\000\000\000\000\000\000", !42, !1, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
85 !8 = !{null}
86 !9 = !{!"0x101\00sp\0016777223\000", !0, !1, !10, !32} ; [ DW_TAG_arg_variable ]
87 !10 = !{!"0xf\00\000\0064\0064\000\000", null, !2, !11} ; [ DW_TAG_pointer_type ]
88 !11 = !{!"0x16\00S1\004\000\000\000\000", !42, !2, !12} ; [ DW_TAG_typedef ]
89 !12 = !{!"0x13\00S1\001\00128\0064\000\000\000", !42, !2, null, !13, null, null, null} ; [ DW_TAG_structure_type ] [S1] [line 1, size 128, align 64, offset 0] [def] [from ]
90 !13 = !{!14, !17}
91 !14 = !{!"0xd\00m\002\0064\0064\000\000", !42, !1, !15} ; [ DW_TAG_member ]
92 !15 = !{!"0xf\00\000\0064\0064\000\000", null, !2, !16} ; [ DW_TAG_pointer_type ]
93 !16 = !{!"0x24\00float\000\0032\0032\000\000\004", null, !2} ; [ DW_TAG_base_type ]
94 !17 = !{!"0xd\00nums\003\0032\0032\0064\000", !42, !1, !5} ; [ DW_TAG_member ]
95 !18 = !{!"0x101\00nums\0033554439\000", !0, !1, !5, !32} ; [ DW_TAG_arg_variable ]
96 !19 = !{!"0x34\00p\00p\00\0014\000\001", !2, !1, !11, %struct.S1* @p, null} ; [ DW_TAG_variable ]
97 !20 = !MDLocation(line: 7, column: 13, scope: !0)
98 !21 = !MDLocation(line: 7, column: 21, scope: !0)
99 !22 = !MDLocation(line: 9, column: 3, scope: !23)
100 !23 = !{!"0xb\008\001\000", !1, !0} ; [ DW_TAG_lexical_block ]
101 !27 = !MDLocation(line: 10, column: 3, scope: !23)
102 !29 = !MDLocation(line: 11, column: 3, scope: !23)
103 !30 = !{%struct.S1* @p}
104 !31 = !MDLocation(line: 7, column: 13, scope: !0, inlinedAt: !32)
105 !32 = !MDLocation(line: 16, column: 3, scope: !33)
106 !33 = !{!"0xb\0015\0015\001", !1, !6} ; [ DW_TAG_lexical_block ]
107 !34 = !{i32 1}
108 !35 = !MDLocation(line: 7, column: 21, scope: !0, inlinedAt: !32)
109 !36 = !MDLocation(line: 9, column: 3, scope: !23, inlinedAt: !32)
110 !37 = !MDLocation(line: 10, column: 3, scope: !23, inlinedAt: !32)
111 !38 = !MDLocation(line: 17, column: 1, scope: !33)
112 !39 = !{!0, !6}
113 !40 = !{!19}
114 !41 = !{!9, !18}
115 !42 = !{!"nm2.c", !"/private/tmp"}
116 !43 = !{i32 1, !"Debug Info Version", i32 2}
117 !44 = !{}