2011-11-05 04:20:34 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
|
2013-01-26 05:44:53 +08:00
|
|
|
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
|
2011-11-05 03:00:29 +08:00
|
|
|
|
|
|
|
; test that the DW_AT_specification is a back edge in the file.
|
|
|
|
|
2013-10-29 08:58:04 +08:00
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "zed")
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK-NEXT: DW_AT_specification [DW_FORM_ref4] (cu + {{.*}} => {[[BACK:0x[0-9a-f]*]]})
|
|
|
|
; CHECK: [[BACK]]: DW_TAG_subprogram
|
2011-11-05 03:00:29 +08:00
|
|
|
|
|
|
|
%struct.foo = type { i8 }
|
|
|
|
|
|
|
|
define void @_Z3zedP3foo(%struct.foo* %x) uwtable {
|
|
|
|
entry:
|
|
|
|
%x.addr = alloca %struct.foo*, align 8
|
|
|
|
store %struct.foo* %x, %struct.foo** %x.addr, align 8
|
|
|
|
call void @llvm.dbg.declare(metadata !{%struct.foo** %x.addr}, metadata !23), !dbg !24
|
|
|
|
%0 = load %struct.foo** %x.addr, align 8, !dbg !25
|
|
|
|
call void @_ZN3foo3barEv(%struct.foo* %0), !dbg !25
|
|
|
|
ret void, !dbg !27
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
|
|
|
|
|
|
|
|
define linkonce_odr void @_ZN3foo3barEv(%struct.foo* %this) nounwind uwtable align 2 {
|
|
|
|
entry:
|
|
|
|
%this.addr = alloca %struct.foo*, align 8
|
|
|
|
store %struct.foo* %this, %struct.foo** %this.addr, align 8
|
|
|
|
call void @llvm.dbg.declare(metadata !{%struct.foo** %this.addr}, metadata !28), !dbg !29
|
|
|
|
%this1 = load %struct.foo** %this.addr
|
|
|
|
ret void, !dbg !30
|
|
|
|
}
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-23 05:49:45 +08:00
|
|
|
!llvm.module.flags = !{!33}
|
2011-11-05 03:00:29 +08:00
|
|
|
|
2013-04-22 14:12:31 +08:00
|
|
|
!0 = metadata !{i32 786449, metadata !32, i32 4, metadata !"clang version 3.0 ()", i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !1, metadata !1, metadata !""} ; [ DW_TAG_compile_unit ]
|
2013-02-02 13:56:24 +08:00
|
|
|
!1 = metadata !{i32 0}
|
|
|
|
!3 = metadata !{metadata !5, metadata !20}
|
2013-09-07 05:03:58 +08:00
|
|
|
!5 = metadata !{i32 720942, metadata !6, metadata !6, metadata !"zed", metadata !"zed", metadata !"_Z3zedP3foo", i32 4, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.foo*)* @_Z3zedP3foo, null, null, metadata !21, i32 4} ; [ DW_TAG_subprogram ] [line 4] [def] [zed]
|
2013-03-28 10:44:59 +08:00
|
|
|
!6 = metadata !{i32 720937, metadata !32} ; [ DW_TAG_file_type ]
|
2013-09-08 11:11:54 +08:00
|
|
|
!7 = metadata !{i32 720917, i32 0, null, i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!8 = metadata !{null, metadata !9}
|
2013-03-28 10:44:59 +08:00
|
|
|
!9 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ]
|
2013-08-27 06:39:55 +08:00
|
|
|
!10 = metadata !{i32 720898, metadata !32, null, metadata !"foo", i32 1, i64 8, i64 8, i32 0, i32 0, null, metadata !11, i32 0, null, null, null} ; [ DW_TAG_class_type ] [foo] [line 1, size 8, align 8, offset 0] [def] [from ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!11 = metadata !{metadata !12}
|
2013-03-28 10:44:59 +08:00
|
|
|
!12 = metadata !{i32 720942, metadata !6, metadata !10, metadata !"bar", metadata !"bar", metadata !"_ZN3foo3barEv", i32 2, metadata !13, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null, i32 0, metadata !16, i32 2} ; [ DW_TAG_subprogram ]
|
2013-09-08 11:11:54 +08:00
|
|
|
!13 = metadata !{i32 720917, i32 0, null, i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, null, metadata !14, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!14 = metadata !{null, metadata !15}
|
2013-09-08 11:11:54 +08:00
|
|
|
!15 = metadata !{i32 786447, i32 0, null, i32 0, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !10} ; [ DW_TAG_pointer_type ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!16 = metadata !{metadata !17}
|
|
|
|
!17 = metadata !{i32 720932} ; [ DW_TAG_base_type ]
|
|
|
|
!18 = metadata !{metadata !19}
|
|
|
|
!19 = metadata !{i32 720932} ; [ DW_TAG_base_type ]
|
2013-09-07 05:03:58 +08:00
|
|
|
!20 = metadata !{i32 720942, metadata !6, null, metadata !"bar", metadata !"bar", metadata !"_ZN3foo3barEv", i32 2, metadata !13, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.foo*)* @_ZN3foo3barEv, null, metadata !12, metadata !21, i32 2} ; [ DW_TAG_subprogram ] [line 2] [def] [bar]
|
2011-11-05 03:00:29 +08:00
|
|
|
!21 = metadata !{metadata !22}
|
|
|
|
!22 = metadata !{i32 720932} ; [ DW_TAG_base_type ]
|
2013-03-12 06:37:40 +08:00
|
|
|
!23 = metadata !{i32 786689, metadata !5, metadata !"x", metadata !6, i32 16777220, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!24 = metadata !{i32 4, i32 15, metadata !5, null}
|
|
|
|
!25 = metadata !{i32 4, i32 20, metadata !26, null}
|
2013-03-28 10:44:59 +08:00
|
|
|
!26 = metadata !{i32 786443, metadata !6, metadata !5, i32 4, i32 18, i32 0} ; [ DW_TAG_lexical_block ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!27 = metadata !{i32 4, i32 30, metadata !26, null}
|
2013-03-12 06:37:40 +08:00
|
|
|
!28 = metadata !{i32 786689, metadata !20, metadata !"this", metadata !6, i32 16777218, metadata !15, i32 64, i32 0} ; [ DW_TAG_arg_variable ]
|
2011-11-05 03:00:29 +08:00
|
|
|
!29 = metadata !{i32 2, i32 8, metadata !20, null}
|
|
|
|
!30 = metadata !{i32 2, i32 15, metadata !31, null}
|
2013-03-28 10:44:59 +08:00
|
|
|
!31 = metadata !{i32 786443, metadata !6, metadata !20, i32 2, i32 14, i32 1} ; [ DW_TAG_lexical_block ]
|
2013-03-18 05:13:55 +08:00
|
|
|
!32 = metadata !{metadata !"/home/espindola/llvm/test.cc", metadata !"/home/espindola/tmpfs/build"}
|
2013-11-23 05:49:45 +08:00
|
|
|
!33 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
|