]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll
1d0f9755093374fd49bab4b9e07b99dddec92f7c
[opencl/llvm.git] / test / DebugInfo / 2010-04-06-NestedFnDbgInfo.ll
1 ; REQUIRES: object-emission
3 ; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
4 ; Radar 7833483
5 ; Do not emit a separate out-of-line definition DIE for the function-local 'foo'
6 ; function (member of the function local 'A' type)
7 ; CHECK: DW_TAG_class_type
8 ; CHECK: DW_TAG_class_type
9 ; CHECK-NEXT: DW_AT_name {{.*}} "A"
10 ; Check that the subprogram inside the class definition has low_pc, only
11 ; attached to the definition.
12 ; CHECK: [[FOO_INL:0x........]]: DW_TAG_subprogram
13 ; CHECK-NOT: DW_TAG
14 ; CHECK: DW_AT_low_pc
15 ; CHECK-NOT: DW_TAG
16 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZZN1B2fnEvEN1A3fooEv"
17 ; And just double check that there's no out of line definition that references
18 ; this subprogram.
19 ; CHECK-NOT: DW_AT_specification {{.*}} {[[FOO_INL]]}
21 %class.A = type { i8 }
22 %class.B = type { i8 }
24 define i32 @main() ssp {
25 entry:
26   %retval = alloca i32, align 4                   ; <i32*> [#uses=3]
27   %b = alloca %class.A, align 1                   ; <%class.A*> [#uses=1]
28   store i32 0, i32* %retval
29   call void @llvm.dbg.declare(metadata %class.A* %b, metadata !0, metadata !{!"0x102"}), !dbg !14
30   %call = call i32 @_ZN1B2fnEv(%class.A* %b), !dbg !15 ; <i32> [#uses=1]
31   store i32 %call, i32* %retval, !dbg !15
32   %0 = load i32* %retval, !dbg !16                ; <i32> [#uses=1]
33   ret i32 %0, !dbg !16
34 }
36 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
38 define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 {
39 entry:
40   %retval = alloca i32, align 4                   ; <i32*> [#uses=2]
41   %this.addr = alloca %class.A*, align 8          ; <%class.A**> [#uses=2]
42   %a = alloca %class.A, align 1                   ; <%class.A*> [#uses=1]
43   %i = alloca i32, align 4                        ; <i32*> [#uses=2]
44   store %class.A* %this, %class.A** %this.addr
45   call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !{!"0x102"}), !dbg !18
46   %this1 = load %class.A** %this.addr             ; <%class.A*> [#uses=0]
47   call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !{!"0x102"}), !dbg !27
48   call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !{!"0x102"}), !dbg !29
49   %call = call i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %a), !dbg !30 ; <i32> [#uses=1]
50   store i32 %call, i32* %i, !dbg !30
51   %tmp = load i32* %i, !dbg !31                   ; <i32> [#uses=1]
52   store i32 %tmp, i32* %retval, !dbg !31
53   %0 = load i32* %retval, !dbg !32                ; <i32> [#uses=1]
54   ret i32 %0, !dbg !32
55 }
57 define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 {
58 entry:
59   %retval = alloca i32, align 4                   ; <i32*> [#uses=2]
60   %this.addr = alloca %class.A*, align 8          ; <%class.A**> [#uses=2]
61   store %class.A* %this, %class.A** %this.addr
62   call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !{!"0x102"}), !dbg !34
63   %this1 = load %class.A** %this.addr             ; <%class.A*> [#uses=0]
64   store i32 42, i32* %retval, !dbg !35
65   %0 = load i32* %retval, !dbg !35                ; <i32> [#uses=1]
66   ret i32 %0, !dbg !35
67 }
69 !llvm.dbg.cu = !{!4}
70 !llvm.module.flags = !{!40}
71 !37 = !{!2, !10, !23}
73 !0 = !{!"0x100\00b\0016\000", !1, !3, !8} ; [ DW_TAG_auto_variable ]
74 !1 = !{!"0xb\0015\0012\000", !38, !2} ; [ DW_TAG_lexical_block ]
75 !2 = !{!"0x2e\00main\00main\00main\0015\000\001\000\006\000\000\0015", !38, !3, !5, null, i32 ()* @main, null, null, null} ; [ DW_TAG_subprogram ]
76 !3 = !{!"0x29", !38} ; [ DW_TAG_file_type ]
77 !4 = !{!"0x11\004\00clang 1.5\000\00\000\00\000", !38, !39, !39, !37, null,  null} ; [ DW_TAG_compile_unit ]
78 !5 = !{!"0x15\00\000\000\000\000\000\000", !38, !3, null, !6, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
79 !6 = !{!7}
80 !7 = !{!"0x24\00int\000\0032\0032\000\000\005", !38, !3} ; [ DW_TAG_base_type ]
81 !8 = !{!"0x2\00B\002\008\008\000\000\000", !38, !3, null, !9, null, null, null} ; [ DW_TAG_class_type ] [B] [line 2, size 8, align 8, offset 0] [def] [from ]
82 !9 = !{!10}
83 !10 = !{!"0x2e\00fn\00fn\00_ZN1B2fnEv\004\000\001\000\006\000\000\004", !38, !8, !11, null, i32 (%class.A*)* @_ZN1B2fnEv, null, null, null} ; [ DW_TAG_subprogram ]
84 !11 = !{!"0x15\00\000\000\000\000\000\000", !38, !3, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
85 !12 = !{!7, !13}
86 !13 = !{!"0xf\00\000\0064\0064\000\0064", !38, !3, !8} ; [ DW_TAG_pointer_type ]
87 !14 = !{i32 16, i32 5, !1, null}
88 !15 = !{i32 17, i32 3, !1, null}
89 !16 = !{i32 18, i32 1, !2, null}
90 !17 = !{!"0x101\00this\004\000", !10, !3, !13} ; [ DW_TAG_arg_variable ]
91 !18 = !{i32 4, i32 7, !10, null}
92 !19 = !{!"0x100\00a\009\000", !20, !3, !21} ; [ DW_TAG_auto_variable ]
93 !20 = !{!"0xb\004\0012\000", !38, !10} ; [ DW_TAG_lexical_block ]
94 !21 = !{!"0x2\00A\005\008\008\000\000\000", !38, !10, null, !22, null, null, null} ; [ DW_TAG_class_type ] [A] [line 5, size 8, align 8, offset 0] [def] [from ]
95 !22 = !{!23}
96 !23 = !{!"0x2e\00foo\00foo\00_ZZN1B2fnEvEN1A3fooEv\007\000\001\000\006\000\000\007", !38, !21, !24, null, i32 (%class.A*)* @_ZZN1B2fnEvEN1A3fooEv, null, null, null} ; [ DW_TAG_subprogram ]
97 !24 = !{!"0x15\00\000\000\000\000\000\000", !38, !3, null, !25, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
98 !25 = !{!7, !26}
99 !26 = !{!"0xf\00\000\0064\0064\000\0064", !38, !3, !21} ; [ DW_TAG_pointer_type ]
100 !27 = !{i32 9, i32 7, !20, null}
101 !28 = !{!"0x100\00i\0010\000", !20, !3, !7} ; [ DW_TAG_auto_variable ]
102 !29 = !{i32 10, i32 9, !20, null}
103 !30 = !{i32 10, i32 5, !20, null}
104 !31 = !{i32 11, i32 5, !20, null}
105 !32 = !{i32 12, i32 3, !10, null}
106 !33 = !{!"0x101\00this\007\000", !23, !3, !26} ; [ DW_TAG_arg_variable ]
107 !34 = !{i32 7, i32 11, !23, null}
108 !35 = !{i32 7, i32 19, !36, null}
109 !36 = !{!"0xb\007\0017\000", !38, !23} ; [ DW_TAG_lexical_block ]
110 !38 = !{!"one.cc", !"/tmp" }
111 !39 = !{i32 0}
112 !40 = !{i32 1, !"Debug Info Version", i32 2}