llvm-mirror/test/MC/ELF/debug-prefix-map.s
Paul Robinson 4b9594a54b [DWARF] Make -g with empty assembler source work better.
This was sometimes causing clang or llvm-mc to crash, and in other
cases could emit a bogus DWARF line-table header. I did an interim
patch in r352541; this patch should be a cleaner and more complete
fix, and retains the test.

Addresses PR40538.

Differential Revision: https://reviews.llvm.org/D58750

llvm-svn: 355226
2019-03-01 20:58:04 +00:00

26 lines
1.1 KiB
ArmAsm

// RUN: mkdir -p %t.foo
// RUN: cp %s %t.foo/src.s
// RUN: cd %t.foo
// RUN: llvm-mc -triple=x86_64-linux-unknown -g src.s -filetype=obj -o out.o
// RUN: llvm-dwarfdump -v -debug-info out.o | FileCheck --check-prefix=NO_MAP %s
// RUN: llvm-mc -triple=x86_64-linux-unknown -g src.s -filetype=obj -o out.o -fdebug-prefix-map=%t.foo=src_root
// RUN: llvm-dwarfdump -v -debug-info out.o | FileCheck --check-prefix=MAP --implicit-check-not ".foo" %s
// RUN: llvm-mc -triple=x86_64-linux-unknown -g %t.foo/src.s -filetype=obj -o out.o -fdebug-prefix-map=%t.foo=/src_root
// RUN: llvm-dwarfdump -v -debug-info out.o | FileCheck --check-prefix=MAP_ABS --implicit-check-not ".foo" %s
f:
nop
// NO_MAP: DW_AT_comp_dir [DW_FORM_string] ("{{.*}}.foo")
// MAP: DW_AT_name [DW_FORM_string] ("src.s")
// MAP: DW_AT_comp_dir [DW_FORM_string] ("src_root")
// MAP: DW_AT_decl_file [DW_FORM_data4] ("src_root{{(/|\\)+}}src.s")
// MAP_ABS: DW_AT_name [DW_FORM_string] ("src.s")
// MAP_ABS: DW_AT_comp_dir [DW_FORM_string] ("{{(/|\\)+}}src_root")
// MAP_ABS: DW_AT_decl_file [DW_FORM_data4] ("{{(/|\\)+}}src_root{{(/|\\)+}}src.s")