Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
      2 ; RUN: llvm-dwarfdump %t | FileCheck %s
      3 
      4 ; test that the DW_AT_specification is a back edge in the file.
      5 
      6 ; CHECK: 0x0000005c:     DW_TAG_subprogram [5]
      7 ; CHECK: 0x0000007c:     DW_AT_specification [DW_FORM_ref4]      (cu + 0x005c => {0x0000005c})
      8 
      9 %struct.foo = type { i8 }
     10 
     11 define void @_Z3zedP3foo(%struct.foo* %x) uwtable {
     12 entry:
     13   %x.addr = alloca %struct.foo*, align 8
     14   store %struct.foo* %x, %struct.foo** %x.addr, align 8
     15   call void @llvm.dbg.declare(metadata !{%struct.foo** %x.addr}, metadata !23), !dbg !24
     16   %0 = load %struct.foo** %x.addr, align 8, !dbg !25
     17   call void @_ZN3foo3barEv(%struct.foo* %0), !dbg !25
     18   ret void, !dbg !27
     19 }
     20 
     21 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
     22 
     23 define linkonce_odr void @_ZN3foo3barEv(%struct.foo* %this) nounwind uwtable align 2 {
     24 entry:
     25   %this.addr = alloca %struct.foo*, align 8
     26   store %struct.foo* %this, %struct.foo** %this.addr, align 8
     27   call void @llvm.dbg.declare(metadata !{%struct.foo** %this.addr}, metadata !28), !dbg !29
     28   %this1 = load %struct.foo** %this.addr
     29   ret void, !dbg !30
     30 }
     31 
     32 !llvm.dbg.cu = !{!0}
     33 
     34 !0 = metadata !{i32 720913, i32 0, i32 4, metadata !"/home/espindola/llvm/test.cc", metadata !"/home/espindola/tmpfs/build", metadata !"clang version 3.0 ()", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !1} ; [ DW_TAG_compile_unit ]
     35 !1 = metadata !{metadata !2}
     36 !2 = metadata !{i32 0}
     37 !3 = metadata !{metadata !4}
     38 !4 = metadata !{metadata !5, metadata !20}
     39 !5 = metadata !{i32 720942, i32 0, metadata !6, metadata !"zed", metadata !"zed", metadata !"_Z3zedP3foo", metadata !6, i32 4, metadata !7, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, void (%struct.foo*)* @_Z3zedP3foo, null, null, metadata !18} ; [ DW_TAG_subprogram ]
     40 !6 = metadata !{i32 720937, metadata !"/home/espindola/llvm/test.cc", metadata !"/home/espindola/tmpfs/build", null} ; [ DW_TAG_file_type ]
     41 !7 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
     42 !8 = metadata !{null, metadata !9}
     43 !9 = metadata !{i32 720911, null, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ]
     44 !10 = metadata !{i32 720898, null, metadata !"foo", metadata !6, i32 1, i64 8, i64 8, i32 0, i32 0, null, metadata !11, i32 0, null, null} ; [ DW_TAG_class_type ]
     45 !11 = metadata !{metadata !12}
     46 !12 = metadata !{i32 720942, i32 0, metadata !10, metadata !"bar", metadata !"bar", metadata !"_ZN3foo3barEv", metadata !6, i32 2, metadata !13, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null, i32 0, metadata !16} ; [ DW_TAG_subprogram ]
     47 !13 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !14, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
     48 !14 = metadata !{null, metadata !15}
     49 !15 = metadata !{i32 720911, i32 0, metadata !"", i32 0, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !10} ; [ DW_TAG_pointer_type ]
     50 !16 = metadata !{metadata !17}
     51 !17 = metadata !{i32 720932}                      ; [ DW_TAG_base_type ]
     52 !18 = metadata !{metadata !19}
     53 !19 = metadata !{i32 720932}                      ; [ DW_TAG_base_type ]
     54 !20 = metadata !{i32 720942, i32 0, null, metadata !"bar", metadata !"bar", metadata !"_ZN3foo3barEv", metadata !6, i32 2, metadata !13, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, void (%struct.foo*)* @_ZN3foo3barEv, null, metadata !12, metadata !21} ; [ DW_TAG_subprogram ]
     55 !21 = metadata !{metadata !22}
     56 !22 = metadata !{i32 720932}                      ; [ DW_TAG_base_type ]
     57 !23 = metadata !{i32 721153, metadata !5, metadata !"x", metadata !6, i32 16777220, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ]
     58 !24 = metadata !{i32 4, i32 15, metadata !5, null}
     59 !25 = metadata !{i32 4, i32 20, metadata !26, null}
     60 !26 = metadata !{i32 720907, metadata !5, i32 4, i32 18, metadata !6, i32 0} ; [ DW_TAG_lexical_block ]
     61 !27 = metadata !{i32 4, i32 30, metadata !26, null}
     62 !28 = metadata !{i32 721153, metadata !20, metadata !"this", metadata !6, i32 16777218, metadata !15, i32 64, i32 0} ; [ DW_TAG_arg_variable ]
     63 !29 = metadata !{i32 2, i32 8, metadata !20, null}
     64 !30 = metadata !{i32 2, i32 15, metadata !31, null}
     65 !31 = metadata !{i32 720907, metadata !20, i32 2, i32 14, metadata !6, i32 1} ; [ DW_TAG_lexical_block ]
     66