virtual-index.ll 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
  3. ; RUN: llvm-dwarfdump -v %t | FileCheck %s
  4. ; Generated from the following C++ source code:
  5. ;
  6. ; struct A {
  7. ; virtual void f();
  8. ; virtual void g();
  9. ; };
  10. ;
  11. ; void A::f() {}
  12. ; void A::g() {}
  13. ;
  14. ; and manually edited to set virtualIndex attribute on the A::g subprogram to
  15. ; 4294967295.
  16. ; CHECK: DW_TAG_subprogram [
  17. ; CHECK: DW_AT_vtable_elem_location [DW_FORM_exprloc] (DW_OP_constu 0x0)
  18. ; CHECK: DW_TAG_subprogram [
  19. ; CHECK-NOT: DW_AT_vtable_elem_location
  20. %struct.A = type { i32 (...)** }
  21. @_ZTV1A = unnamed_addr constant [4 x i8*] [i8* null, i8* null, i8* bitcast (void (%struct.A*)* @_ZN1A1fEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1gEv to i8*)], align 8
  22. define void @_ZN1A1fEv(%struct.A* %this) unnamed_addr !dbg !18 {
  23. ret void
  24. }
  25. define void @_ZN1A1gEv(%struct.A* %this) unnamed_addr !dbg !19 {
  26. ret void
  27. }
  28. !llvm.dbg.cu = !{!0}
  29. !llvm.module.flags = !{!20, !21}
  30. !llvm.ident = !{!22}
  31. !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3)
  32. !1 = !DIFile(filename: "x", directory: "x")
  33. !2 = !{}
  34. !3 = !{!4}
  35. !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 64, align: 64, elements: !5, vtableHolder: !4, identifier: "_ZTS1A")
  36. !5 = !{!6, !12, !16}
  37. !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !1, file: !1, baseType: !7, size: 64, flags: DIFlagArtificial)
  38. !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
  39. !8 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !9, size: 64)
  40. !9 = !DISubroutineType(types: !10)
  41. !10 = !{!11}
  42. !11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  43. !12 = !DISubprogram(name: "f", linkageName: "_ZN1A1fEv", scope: !4, file: !1, line: 2, type: !13, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !4, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
  44. !13 = !DISubroutineType(types: !14)
  45. !14 = !{null, !15}
  46. !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
  47. !16 = !DISubprogram(name: "g", linkageName: "_ZN1A1gEv", scope: !4, file: !1, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, containingType: !4, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 4294967295, flags: DIFlagPrototyped, isOptimized: false)
  48. !18 = distinct !DISubprogram(name: "f", linkageName: "_ZN1A1fEv", scope: !4, file: !1, line: 6, type: !13, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !12, retainedNodes: !2)
  49. !19 = distinct !DISubprogram(name: "g", linkageName: "_ZN1A1gEv", scope: !4, file: !1, line: 7, type: !13, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !16, retainedNodes: !2)
  50. !20 = !{i32 2, !"Dwarf Version", i32 4}
  51. !21 = !{i32 2, !"Debug Info Version", i32 3}
  52. !22 = !{!"clang version 3.9.0 (trunk 263469) (llvm/trunk 263156)"}
  53. !23 = !DILocalVariable(name: "this", arg: 1, scope: !18, type: !24, flags: DIFlagArtificial | DIFlagObjectPointer)
  54. !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
  55. !25 = !DIExpression()
  56. !26 = !DILocation(line: 0, scope: !18)
  57. !27 = !DILocation(line: 6, column: 14, scope: !18)
  58. !28 = !DILocalVariable(name: "this", arg: 1, scope: !19, type: !24, flags: DIFlagArtificial | DIFlagObjectPointer)
  59. !29 = !DILocation(line: 0, scope: !19)
  60. !30 = !DILocation(line: 7, column: 14, scope: !19)