basic-linking-x86.test 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. REQUIRES: shell
  2. RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
  3. RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1
  4. RUN: llvm-dwarfdump %t1.dwarf | FileCheck %s
  5. RUN: llvm-dsymutil -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
  6. RUN: llvm-dwarfdump %t2 | FileCheck %s
  7. RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
  8. RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
  9. RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -y -o - - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
  10. RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -o - -y - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
  11. CHECK: file format Mach-O 64-bit x86-64
  12. CHECK: debug_info contents
  13. CHECK: Compile Unit:
  14. CHECK: DW_TAG_compile_unit [1] *
  15. CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
  16. CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
  17. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
  18. CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)
  19. CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
  20. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
  21. CHECK: DW_TAG_subprogram [2] *
  22. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000051] = "main")
  23. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
  24. CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
  25. CHECK: DW_AT_prototyped [DW_FORM_flag] (0x01)
  26. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
  27. CHECK: DW_AT_external [DW_FORM_flag] (0x01)
  28. CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
  29. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
  30. CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000ec4)
  31. CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
  32. CHECK: DW_TAG_formal_parameter [3]
  33. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
  34. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
  35. CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
  36. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
  37. CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 78 )
  38. CHECK: DW_TAG_formal_parameter [3]
  39. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005b] = "argv")
  40. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
  41. CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
  42. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006a => {0x0000006a})
  43. CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 70 )
  44. CHECK: NULL
  45. CHECK: DW_TAG_base_type [4]
  46. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
  47. CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
  48. CHECK: DW_AT_byte_size [DW_FORM_data1] (0x04)
  49. CHECK: DW_TAG_pointer_type [5]
  50. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006f => {0x0000006f})
  51. CHECK: DW_TAG_pointer_type [5]
  52. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074})
  53. CHECK: DW_TAG_const_type [6]
  54. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0079 => {0x00000079})
  55. CHECK: DW_TAG_base_type [4]
  56. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "char")
  57. CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
  58. CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
  59. CHECK: NULL
  60. CHECK: Compile Unit:
  61. CHECK: DW_TAG_compile_unit [1] *
  62. CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
  63. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
  64. CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000003f)
  65. CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
  66. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
  67. CHECK: DW_TAG_base_type [4]
  68. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
  69. CHECK: DW_TAG_variable [7]
  70. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000072] = "private_int")
  71. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
  72. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
  73. BASIC: DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
  74. ARCHIVE: DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
  75. CHECK: DW_TAG_variable [7]
  76. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000007e] = "baz")
  77. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
  78. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
  79. CHECK: DW_AT_location [DW_FORM_block1] (<0x09> 03 00 10 00 00 01 00 00 00 )
  80. CHECK: DW_TAG_subprogram [2] *
  81. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000082] = "foo")
  82. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
  83. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
  84. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
  85. CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f19)
  86. CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
  87. CHECK: DW_TAG_formal_parameter [3]
  88. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
  89. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
  90. CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 7c )
  91. CHECK: NULL
  92. CHECK: DW_TAG_subprogram [8]
  93. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
  94. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
  95. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f20)
  96. CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f37)
  97. CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
  98. CHECK: NULL
  99. CHECK: Compile Unit:
  100. CHECK: DW_TAG_compile_unit [1] *
  101. CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
  102. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
  103. CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000093)
  104. CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
  105. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
  106. CHECK: DW_TAG_variable [9]
  107. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000097] = "val")
  108. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x00000162})
  109. CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
  110. BASIC: DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
  111. ARCHIVE: DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
  112. CHECK: DW_TAG_volatile_type [10]
  113. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
  114. CHECK: DW_TAG_base_type [4]
  115. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
  116. CHECK: DW_TAG_subprogram [2] *
  117. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009b] = "bar")
  118. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
  119. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
  120. CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f84)
  121. CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
  122. CHECK: DW_TAG_formal_parameter [3]
  123. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
  124. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
  125. CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 78 )
  126. CHECK: NULL
  127. CHECK: DW_TAG_subprogram [8]
  128. CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
  129. CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
  130. CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
  131. CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fa9)
  132. CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
  133. CHECK: NULL
  134. CHECK: .debug_loc contents
  135. CHECK-NOT: Location
  136. CHECK:.debug_aranges contents:
  137. CHECK-NEXT:Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
  138. CHECK-NEXT:[0x0000000100000ea0 - 0x0000000100000ec4)
  139. CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
  140. CHECK-NEXT:[0x0000000100000ed0 - 0x0000000100000f19)
  141. CHECK-NEXT:[0x0000000100000f20 - 0x0000000100000f37)
  142. CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000126, addr_size = 0x08, seg_size = 0x00
  143. CHECK-NEXT:[0x0000000100000f40 - 0x0000000100000f84)
  144. CHECK-NEXT:[0x0000000100000f90 - 0x0000000100000fa9)
  145. CHECK: .debug_line contents:
  146. CHECK: Dir Mod Time File Len File Name
  147. CHECK-NEXT: ---- ---------- ---------- ---------------------------
  148. CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c
  149. CHECK: Address Line Column File ISA Discriminator Flags
  150. CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
  151. CHECK-NEXT: 0x0000000100000ea0 23 0 1 0 0 is_stmt
  152. CHECK-NEXT: 0x0000000100000eb6 24 0 1 0 0 is_stmt prologue_end
  153. CHECK-NEXT: 0x0000000100000ec4 24 0 1 0 0 is_stmt end_sequence
  154. CHECK: Dir Mod Time File Len File Name
  155. CHECK-NEXT: ---- ---------- ---------- ---------------------------
  156. CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c
  157. CHECK: Address Line Column File ISA Discriminator Flags
  158. CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
  159. CHECK-NEXT: 0x0000000100000ed0 19 0 1 0 0 is_stmt
  160. CHECK-NEXT: 0x0000000100000ee2 20 0 1 0 0 is_stmt prologue_end
  161. CHECK-NEXT: 0x0000000100000f19 20 0 1 0 0 is_stmt end_sequence
  162. CHECK-NEXT: 0x0000000100000f20 14 0 1 0 0 is_stmt
  163. CHECK-NEXT: 0x0000000100000f24 15 0 1 0 0 is_stmt prologue_end
  164. CHECK-NEXT: 0x0000000100000f37 15 0 1 0 0 is_stmt end_sequence
  165. CHECK: Dir Mod Time File Len File Name
  166. CHECK-NEXT: ---- ---------- ---------- ---------------------------
  167. CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c
  168. CHECK: Address Line Column File ISA Discriminator Flags
  169. CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
  170. CHECK-NEXT: 0x0000000100000f40 16 0 1 0 0 is_stmt
  171. CHECK-NEXT: 0x0000000100000f4b 17 0 1 0 0 is_stmt prologue_end
  172. CHECK-NEXT: 0x0000000100000f58 18 0 1 0 0 is_stmt
  173. CHECK-NEXT: 0x0000000100000f6c 19 0 1 0 0 is_stmt
  174. CHECK-NEXT: 0x0000000100000f7b 20 0 1 0 0 is_stmt
  175. CHECK-NEXT: 0x0000000100000f84 20 0 1 0 0 is_stmt end_sequence
  176. CHECK-NEXT: 0x0000000100000f90 11 0 1 0 0 is_stmt
  177. CHECK-NEXT: 0x0000000100000f9b 12 0 1 0 0 is_stmt prologue_end
  178. CHECK-NEXT: 0x0000000100000fa9 12 0 1 0 0 is_stmt end_sequence
  179. CHECK: .debug_pubnames contents:
  180. CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
  181. CHECK-NEXT: Offset Name
  182. CHECK-NEXT: 0x00000026 "main"
  183. CHECK-NEXT: length = 0x00000036 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
  184. CHECK-NEXT: Offset Name
  185. CHECK-NEXT: 0x0000002d "private_int"
  186. CHECK-NEXT: 0x00000042 "baz"
  187. CHECK-NEXT: 0x00000057 "foo"
  188. CHECK-NEXT: 0x00000086 "inc"
  189. CHECK-NEXT: length = 0x00000026 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
  190. CHECK-NEXT: Offset Name
  191. CHECK-NEXT: 0x00000026 "val"
  192. CHECK-NEXT: 0x00000048 "bar"
  193. CHECK-NEXT: 0x00000077 "inc"
  194. CHECK: .debug_pubtypes contents:
  195. CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
  196. CHECK-NEXT: Offset Name
  197. CHECK-NEXT: 0x00000063 "int"
  198. CHECK-NEXT: 0x00000079 "char"
  199. CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
  200. CHECK-NEXT: Offset Name
  201. CHECK-NEXT: 0x00000026 "int"
  202. CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
  203. CHECK-NEXT: Offset Name
  204. CHECK-NEXT: 0x00000041 "int"