1 ; REQUIRES: object-emission 2 3 ; RUN: llc -filetype=obj < %s > %t 4 ; RUN: llvm-dwarfdump %t | FileCheck %s 5 6 ; IR generated from clang -O -g with the following source 7 ; 8 ; void f1(int x, int y); 9 ; void f3(int line); 10 ; void f2() { 11 ; f1(1, 2); 12 ; } 13 ; void f1(int x, int y) { 14 ; f3(y); 15 ; } 16 17 ; CHECK: DW_AT_name{{.*}}"f1" 18 ; CHECK: DW_TAG_formal_parameter 19 ; CHECK-NEXT: DW_AT_name{{.*}}"x" 20 ; CHECK: DW_TAG_formal_parameter 21 ; CHECK-NEXT: DW_AT_name{{.*}}"y" 22 23 ; Function Attrs: uwtable 24 define void @_Z2f2v() #0 { 25 tail call void @llvm.dbg.value(metadata !15, i64 0, metadata !16), !dbg !18 26 tail call void @llvm.dbg.value(metadata !19, i64 0, metadata !20), !dbg !18 27 tail call void @_Z2f3i(i32 2), !dbg !21 28 ret void, !dbg !22 29 } 30 31 ; Function Attrs: uwtable 32 define void @_Z2f1ii(i32 %x, i32 %y) #0 { 33 tail call void @llvm.dbg.value(metadata !{i32 %x}, i64 0, metadata !13), !dbg !23 34 tail call void @llvm.dbg.value(metadata !{i32 %y}, i64 0, metadata !14), !dbg !23 35 tail call void @_Z2f3i(i32 %y), !dbg !24 36 ret void, !dbg !25 37 } 38 39 declare void @_Z2f3i(i32) #1 40 41 ; Function Attrs: nounwind readnone 42 declare void @llvm.dbg.value(metadata, i64, metadata) #2 43 44 attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 45 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 46 attributes #2 = { nounwind readnone } 47 48 !llvm.dbg.cu = !{!0} 49 50 !0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 true, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/blaikie/dev/scratch/exp.cpp] [DW_LANG_C_plus_plus] 51 !1 = metadata !{metadata !"exp.cpp", metadata !"/usr/local/google/home/blaikie/dev/scratch"} 52 !2 = metadata !{i32 0} 53 !3 = metadata !{metadata !4, metadata !8} 54 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"f2", metadata !"f2", metadata !"_Z2f2v", i32 3, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, void ()* @_Z2f2v, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [f2] 55 !5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [/usr/local/google/home/blaikie/dev/scratch/exp.cpp] 56 !6 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !7, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] 57 !7 = metadata !{null} 58 !8 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"f1", metadata !"f1", metadata !"_Z2f1ii", i32 6, metadata !9, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, void (i32, i32)* @_Z2f1ii, null, null, metadata !12, i32 6} ; [ DW_TAG_subprogram ] [line 6] [def] [f1] 59 !9 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !10, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] 60 !10 = metadata !{null, metadata !11, metadata !11} 61 !11 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] 62 !12 = metadata !{metadata !13, metadata !14} 63 !13 = metadata !{i32 786689, metadata !8, metadata !"x", metadata !5, i32 16777222, metadata !11, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [x] [line 6] 64 !14 = metadata !{i32 786689, metadata !8, metadata !"y", metadata !5, i32 33554438, metadata !11, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [y] [line 6] 65 !15 = metadata !{i32 undef} 66 !16 = metadata !{i32 786689, metadata !8, metadata !"x", metadata !5, i32 16777222, metadata !11, i32 0, metadata !17} ; [ DW_TAG_arg_variable ] [x] [line 6] 67 !17 = metadata !{i32 4, i32 0, metadata !4, null} 68 !18 = metadata !{i32 6, i32 0, metadata !8, metadata !17} 69 !19 = metadata !{i32 2} 70 !20 = metadata !{i32 786689, metadata !8, metadata !"y", metadata !5, i32 33554438, metadata !11, i32 0, metadata !17} ; [ DW_TAG_arg_variable ] [y] [line 6] 71 !21 = metadata !{i32 7, i32 0, metadata !8, metadata !17} 72 !22 = metadata !{i32 5, i32 0, metadata !4, null} 73 !23 = metadata !{i32 6, i32 0, metadata !8, null} 74 !24 = metadata !{i32 7, i32 0, metadata !8, null} 75 !25 = metadata !{i32 8, i32 0, metadata !8, null} ; [ DW_TAG_imported_declaration ] 76