brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · c9d1560 Raw
54 lines · plain
1$ cat dwarf5-addrx-0x0-last.c2#include <stdio.h>3 4int main (int argc, char const *argv[])5{6  int pass_me = argc + 10;7  printf("Foo\n");8  printf("Bar\n");9 10  return 0;11}12 13$ clang -gdwarf-5 dwarf5-addrx-0x0-last.c -c -o dwarf5-addrx-0x0-last.o14$ clang dwarf5-addrx-0x0-last.o -o dwarf5-addrx-0x0-last.out15 16# Sanity check: make sure main's low PC (0x0) requires an index computation17# into the .debug_addr section.18RUN: llvm-dwarfdump -debug-addr %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.o | FileCheck %s --check-prefix DEBUGADDR19 20DEBUGADDR: Addrs: [21DEBUGADDR: 0x000000000000005422DEBUGADDR: 0x000000000000005923DEBUGADDR: 0x000000000000000024DEBUGADDR: ]25 26RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out -o %t.dSYM 2>&1 | FileCheck %s --allow-empty27RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s28RUN: llvm-dwarfdump --verbose -debug-info %t.dSYM | FileCheck %s --check-prefix DEBUGINFO29RUN: llvm-dwarfdump --verbose -debug-line %t.dSYM | FileCheck %s --check-prefix DEBUGLINE30 31RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs \32RUN:   %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out \33RUN:   -o %t.dSYM 2>&1 | FileCheck %s --allow-empty34RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s35RUN: llvm-dwarfdump --verbose -debug-info %t.dSYM | FileCheck %s --check-prefix DEBUGINFO36RUN: llvm-dwarfdump --verbose -debug-line %t.dSYM | FileCheck %s --check-prefix DEBUGLINE37 38 39CHECK-NOT: error:40 41DEBUGINFO:   DW_TAG_subprogram42DEBUGINFO:     DW_AT_low_pc [DW_FORM_addrx]      (indexed (00000000) address = 0x0000000100003f4c)43DEBUGINFO:     DW_AT_high_pc [DW_FORM_data4]   (0x00000054)44DEBUGINFO:     DW_AT_name [DW_FORM_strx]       (indexed (00000007) string = "main")45 46DEBUGLINE:  0x0000000100003f4c   4   0  {{.*}}  is_stmt47DEBUGLINE:  0x0000000100003f6c   5  17  {{.*}}  is_stmt prologue_end48DEBUGLINE:  0x0000000100003f70   5  22  {{.*}}49DEBUGLINE:  0x0000000100003f74   5   7  {{.*}}50DEBUGLINE:  0x0000000100003f78   6   3  {{.*}}  is_stmt51DEBUGLINE:  0x0000000100003f84   7   3  {{.*}}  is_stmt52DEBUGLINE:  0x0000000100003f94   9   3  {{.*}}  is_stmt epilogue_begin53DEBUGLINE:  0x0000000100003fa0   9   3  {{.*}}  is_stmt end_sequence54