accel-table-hash-collisions.ll 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -accel-tables=Apple -filetype=obj -o - < %s \
  3. ; RUN: | llvm-dwarfdump -apple-names - | FileCheck %s
  4. ; Generated from the following C code using
  5. ; clang -S -emit-llvm hash-collision.c
  6. ;
  7. ; The names of the variables have been chosen so that they produce hash collisions.
  8. ; There are 12 names here that are hashed to only 6 hashes (each pair of lines
  9. ; hashes to the same value, see the CHECK lines below).
  10. ;
  11. ; int ForceTopDown;
  12. ; int _ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_;
  13. ; int _ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE;
  14. ; int _ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv;
  15. ; int _ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE;
  16. ; int _ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE;
  17. ; int k1;
  18. ; int is;
  19. ; int setStmt;
  20. ; int _ZN4llvm5TwineC1Ei;
  21. ; int _ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE;
  22. ; int _ZN4llvm22MachineModuleInfoMachOD2Ev;
  23. ; Check that we have the right amount of hashes.
  24. ; CHECK: Bucket count: 6
  25. ; CHECK: Hashes count: 6
  26. ; Check that all the names are present in the output
  27. ; CHECK: Hash 0x597841
  28. ; CHECK: String: 0x{{[0-9a-f]*}} "is"
  29. ; CHECK: String: 0x{{[0-9a-f]*}} "k1"
  30. ; CHECK: Hash 0xa4b42a1e
  31. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE"
  32. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv"
  33. ; CHECK: Hash 0xeee7c0b2
  34. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE"
  35. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE"
  36. ; CHECK: Hash 0xea48ac5f
  37. ; CHECK: String: 0x{{[0-9a-f]*}} "ForceTopDown"
  38. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_"
  39. ; CHECK: Hash 0x6b22f71f
  40. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE"
  41. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm22MachineModuleInfoMachOD2Ev"
  42. ; CHECK: Hash 0x8c248979
  43. ; CHECK: String: 0x{{[0-9a-f]*}} "setStmt"
  44. ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm5TwineC1Ei"
  45. source_filename = "test/DebugInfo/Generic/accel-table-hash-collisions.ll"
  46. @ForceTopDown = common global i32 0, align 4, !dbg !0
  47. @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_ = common global i32 0, align 4, !dbg !6
  48. @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4, !dbg !9
  49. @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4, !dbg !11
  50. @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4, !dbg !13
  51. @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4, !dbg !15
  52. @k1 = common global i32 0, align 4, !dbg !17
  53. @is = common global i32 0, align 4, !dbg !19
  54. @setStmt = common global i32 0, align 4, !dbg !21
  55. @_ZN4llvm5TwineC1Ei = common global i32 0, align 4, !dbg !23
  56. @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4, !dbg !25
  57. @_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4, !dbg !27
  58. !llvm.dbg.cu = !{!2}
  59. !llvm.module.flags = !{!29, !30, !31}
  60. !llvm.ident = !{!32}
  61. !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
  62. !1 = !DIGlobalVariable(name: "ForceTopDown", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
  63. !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
  64. !3 = !DIFile(filename: "hash-collisions.c", directory: "/tmp")
  65. !4 = !{}
  66. !5 = !{!0, !6, !9, !11, !13, !15, !17, !19, !21, !23, !25, !27}
  67. !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
  68. !7 = !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)
  69. !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  70. !9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())
  71. !10 = !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !2, file: !3, line: 3, type: !8, isLocal: false, isDefinition: true)
  72. !11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())
  73. !12 = !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
  74. !13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())
  75. !14 = !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !2, file: !3, line: 5, type: !8, isLocal: false, isDefinition: true)
  76. !15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression())
  77. !16 = !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !2, file: !3, line: 6, type: !8, isLocal: false, isDefinition: true)
  78. !17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression())
  79. !18 = !DIGlobalVariable(name: "k1", scope: !2, file: !3, line: 7, type: !8, isLocal: false, isDefinition: true)
  80. !19 = !DIGlobalVariableExpression(var: !20, expr: !DIExpression())
  81. !20 = !DIGlobalVariable(name: "is", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true)
  82. !21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression())
  83. !22 = !DIGlobalVariable(name: "setStmt", scope: !2, file: !3, line: 9, type: !8, isLocal: false, isDefinition: true)
  84. !23 = !DIGlobalVariableExpression(var: !24, expr: !DIExpression())
  85. !24 = !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !2, file: !3, line: 10, type: !8, isLocal: false, isDefinition: true)
  86. !25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
  87. !26 = !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !2, file: !3, line: 11, type: !8, isLocal: false, isDefinition: true)
  88. !27 = !DIGlobalVariableExpression(var: !28, expr: !DIExpression())
  89. !28 = !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !2, file: !3, line: 12, type: !8, isLocal: false, isDefinition: true)
  90. !29 = !{i32 2, !"Dwarf Version", i32 2}
  91. !30 = !{i32 2, !"Debug Info Version", i32 3}
  92. !31 = !{i32 1, !"PIC Level", i32 2}
  93. !32 = !{!"clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)"}