inlined-arguments.ll 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -filetype=obj < %s > %t
  3. ; RUN: llvm-dwarfdump %t | FileCheck %s
  4. ; IR generated from clang -O -g with the following source
  5. ;
  6. ; void f1(int x, int y);
  7. ; void f3(int line);
  8. ; void f2() {
  9. ; f1(1, 2);
  10. ; }
  11. ; void f1(int x, int y) {
  12. ; f3(y);
  13. ; }
  14. ; CHECK: DW_AT_name{{.*}}"f1"
  15. ; CHECK: DW_TAG_formal_parameter
  16. ; CHECK-NOT: DW_TAG
  17. ; CHECK: DW_AT_name{{.*}}"x"
  18. ; CHECK: DW_TAG_formal_parameter
  19. ; CHECK-NOT: DW_TAG
  20. ; CHECK: DW_AT_name{{.*}}"y"
  21. ; Function Attrs: uwtable
  22. define void @_Z2f2v() #0 !dbg !4 {
  23. tail call void @llvm.dbg.value(metadata i32 undef, metadata !16, metadata !DIExpression()), !dbg !18
  24. tail call void @llvm.dbg.value(metadata i32 2, metadata !20, metadata !DIExpression()), !dbg !18
  25. tail call void @_Z2f3i(i32 2), !dbg !21
  26. ret void, !dbg !22
  27. }
  28. ; Function Attrs: uwtable
  29. define void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 {
  30. tail call void @llvm.dbg.value(metadata i32 %x, metadata !13, metadata !DIExpression()), !dbg !23
  31. tail call void @llvm.dbg.value(metadata i32 %y, metadata !14, metadata !DIExpression()), !dbg !23
  32. tail call void @_Z2f3i(i32 %y), !dbg !24
  33. ret void, !dbg !25
  34. }
  35. declare void @_Z2f3i(i32) #1
  36. ; Function Attrs: nounwind readnone
  37. declare void @llvm.dbg.value(metadata, metadata, metadata) #2
  38. attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
  39. attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
  40. attributes #2 = { nounwind readnone }
  41. !llvm.dbg.cu = !{!0}
  42. !llvm.module.flags = !{!26}
  43. !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
  44. !1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
  45. !2 = !{}
  46. !4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, retainedNodes: !2)
  47. !5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
  48. !6 = !DISubroutineType(types: !7)
  49. !7 = !{null}
  50. !8 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !9, retainedNodes: !12)
  51. !9 = !DISubroutineType(types: !10)
  52. !10 = !{null, !11, !11}
  53. !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  54. !12 = !{!13, !14}
  55. !13 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11)
  56. !14 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11)
  57. !15 = !{i32 undef}
  58. !16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11)
  59. !17 = !DILocation(line: 4, scope: !4)
  60. !18 = !DILocation(line: 6, scope: !8, inlinedAt: !17)
  61. !19 = !{i32 2}
  62. !20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11)
  63. !21 = !DILocation(line: 7, scope: !8, inlinedAt: !17)
  64. !22 = !DILocation(line: 5, scope: !4)
  65. !23 = !DILocation(line: 6, scope: !8)
  66. !24 = !DILocation(line: 7, scope: !8)
  67. !25 = !DILocation(line: 8, scope: !8)
  68. !26 = !{i32 1, !"Debug Info Version", i32 3}