File: dwarf5-addrx-0x0-last.test

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (53 lines) | stat: -rw-r--r-- 2,242 bytes parent folder | download | duplicates (12)
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
$ cat dwarf5-addrx-0x0-last.c
#include <stdio.h>

int main (int argc, char const *argv[])
{
  int pass_me = argc + 10;
  printf("Foo\n");
  printf("Bar\n");

  return 0;
}

$ clang -gdwarf-5 dwarf5-addrx-0x0-last.c -c -o dwarf5-addrx-0x0-last.o
$ clang dwarf5-addrx-0x0-last.o -o dwarf5-addrx-0x0-last.out

# Sanity check: make sure main's low PC (0x0) requires an index computation
# into the .debug_addr section.
RUN: llvm-dwarfdump -debug-addr %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.o | FileCheck %s --check-prefix DEBUGADDR

DEBUGADDR: Addrs: [
DEBUGADDR: 0x0000000000000054
DEBUGADDR: 0x0000000000000059
DEBUGADDR: 0x0000000000000000
DEBUGADDR: ]

RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s
RUN: llvm-dwarfdump --verbose -debug-info %t.dSYM | FileCheck %s --check-prefix DEBUGINFO
RUN: llvm-dwarfdump --verbose -debug-line %t.dSYM | FileCheck %s --check-prefix DEBUGLINE

RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs \
RUN:   %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out \
RUN:   -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s
RUN: llvm-dwarfdump --verbose -debug-info %t.dSYM | FileCheck %s --check-prefix DEBUGINFO
RUN: llvm-dwarfdump --verbose -debug-line %t.dSYM | FileCheck %s --check-prefix DEBUGLINE


CHECK-NOT: error:

DEBUGINFO:   DW_TAG_subprogram
DEBUGINFO:     DW_AT_low_pc [DW_FORM_addrx]      (indexed (00000000) address = 0x0000000100003f4c)
DEBUGINFO:     DW_AT_high_pc [DW_FORM_data4]   (0x00000054)
DEBUGINFO:     DW_AT_name [DW_FORM_strx]       (indexed (00000007) string = "main")

DEBUGLINE:  0x0000000100003f4c   4   0  {{.*}}  is_stmt
DEBUGLINE:  0x0000000100003f6c   5  17  {{.*}}  is_stmt prologue_end
DEBUGLINE:  0x0000000100003f70   5  22  {{.*}}
DEBUGLINE:  0x0000000100003f74   5   7  {{.*}}
DEBUGLINE:  0x0000000100003f78   6   3  {{.*}}  is_stmt
DEBUGLINE:  0x0000000100003f84   7   3  {{.*}}  is_stmt
DEBUGLINE:  0x0000000100003f94   9   3  {{.*}}  is_stmt epilogue_begin
DEBUGLINE:  0x0000000100003fa0   9   3  {{.*}}  is_stmt end_sequence