1# Check that the llvm-bolt update the dwarf information correctly in case: 2# - DW_AT_low_pc is nullified in case the DW_AT_ranges tag already exists. 3# - DW_AT_high_pc is in the form of DW_FORM_addr. 4 5RUN: yaml2obj %p/Inputs/go_dwarf.yaml &> %t.exe 6RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections 7 8# Check the original binary values. 9RUN: llvm-dwarfdump -debug-info %t.exe 2>&1 | \ 10RUN: FileCheck %s -check-prefix=CHECKORIG 11 12CHECKORIG: DW_TAG_compile_unit 13CHECKORIG-NEXT: DW_AT_producer 14CHECKORIG-NEXT: DW_AT_language 15CHECKORIG-NEXT: DW_AT_name 16CHECKORIG-NEXT: DW_AT_comp_dir 17CHECKORIG-NEXT: DW_AT_ranges (0x00000000 18CHECKORIG-NEXT: [0x0000000000000660, 0x0000000000000684)) 19CHECKORIG-NEXT: DW_AT_low_pc (0x0000000000000660) 20 21CHECKORIG: DW_TAG_subprogram 22CHECKORIG-NEXT: DW_AT_external (true) 23CHECKORIG-NEXT: DW_AT_name ("main") 24CHECKORIG-NEXT: DW_AT_decl_file 25CHECKORIG-NEXT: DW_AT_decl_line (1) 26CHECKORIG-NEXT: DW_AT_decl_column (5) 27CHECKORIG-NEXT: DW_AT_type 28CHECKORIG-NEXT: DW_AT_low_pc (0x0000000000000660) 29CHECKORIG-NEXT: DW_AT_high_pc (0x0000000000000684) 30 31 32# Check the bolted binary. 33RUN: llvm-dwarfdump -debug-info %t.bolt 2>&1 | FileCheck %s 34 35CHECK: DW_TAG_compile_unit 36CHECK-NEXT: DW_AT_producer 37CHECK-NEXT: DW_AT_language 38CHECK-NEXT: DW_AT_name 39CHECK-NEXT: DW_AT_comp_dir 40CHECK-NEXT: DW_AT_ranges (0x00000010 41CHECK-NEXT: [0x0000000000000660, 0x0000000000000684)) 42CHECK-NEXT: DW_AT_low_pc (0x0000000000000000) 43CHECK-NEXT: DW_AT_stmt_list (0x00000000) 44 45CHECK: DW_TAG_subprogram 46CHECK-NEXT: DW_AT_external (true) 47CHECK-NEXT: DW_AT_name ("main") 48CHECK-NEXT: DW_AT_decl_file 49CHECK-NEXT: DW_AT_decl_line (1) 50CHECK-NEXT: DW_AT_decl_column (5) 51CHECK-NEXT: DW_AT_type 52CHECK-NEXT: DW_AT_low_pc (0x0000000000000660) 53CHECK-NEXT: DW_AT_high_pc (0x0000000000000024) 54