File: go_dwarf.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (53 lines) | stat: -rw-r--r-- 2,092 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Check that the llvm-bolt update the dwarf information correctly in case:
#  - DW_AT_low_pc is nullified in case the DW_AT_ranges tag already exists.
#  - DW_AT_high_pc is in the form of DW_FORM_addr.

RUN: yaml2obj %p/Inputs/go_dwarf.yaml &> %t.exe
RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections

# Check the original binary values.
RUN: llvm-dwarfdump -debug-info %t.exe 2>&1 | \
RUN:   FileCheck %s -check-prefix=CHECKORIG

CHECKORIG:         DW_TAG_compile_unit
CHECKORIG-NEXT:        DW_AT_producer
CHECKORIG-NEXT:        DW_AT_language
CHECKORIG-NEXT:        DW_AT_name
CHECKORIG-NEXT:        DW_AT_comp_dir
CHECKORIG-NEXT:        DW_AT_ranges      (0x00000000
CHECKORIG-NEXT:           [0x0000000000000660, 0x0000000000000684))
CHECKORIG-NEXT:        DW_AT_low_pc      (0x0000000000000660)

CHECKORIG:         DW_TAG_subprogram
CHECKORIG-NEXT:        DW_AT_external  (true)
CHECKORIG-NEXT:        DW_AT_name      ("main")
CHECKORIG-NEXT:        DW_AT_decl_file
CHECKORIG-NEXT:        DW_AT_decl_line (1)
CHECKORIG-NEXT:        DW_AT_decl_column       (0x05)
CHECKORIG-NEXT:        DW_AT_type
CHECKORIG-NEXT:        DW_AT_low_pc    (0x0000000000000660)
CHECKORIG-NEXT:        DW_AT_high_pc   (0x0000000000000684)


# Check the bolted binary.
RUN: llvm-dwarfdump -debug-info %t.bolt 2>&1 | FileCheck %s

CHECK:         DW_TAG_compile_unit
CHECK-NEXT:        DW_AT_producer
CHECK-NEXT:        DW_AT_language
CHECK-NEXT:        DW_AT_name
CHECK-NEXT:        DW_AT_comp_dir
CHECK-NEXT:        DW_AT_ranges      (0x00000010
CHECK-NEXT:           [0x0000000000000660, 0x0000000000000684))
CHECK-NEXT:        DW_AT_low_pc      (0x0000000000000000)
CHECK-NEXT:        DW_AT_stmt_list   (0x00000000)

CHECK:         DW_TAG_subprogram
CHECK-NEXT:        DW_AT_external  (true)
CHECK-NEXT:        DW_AT_name      ("main")
CHECK-NEXT:        DW_AT_decl_file
CHECK-NEXT:        DW_AT_decl_line (1)
CHECK-NEXT:        DW_AT_decl_column       (0x05)
CHECK-NEXT:        DW_AT_type
CHECK-NEXT:        DW_AT_low_pc    (0x0000000000000660)
CHECK-NEXT:        DW_AT_high_pc (0x0000000000000024)