[llvm-branch-commits] [llvm] 095ea50 - [MCDwarf][test] Improve debug-prefix-map.s
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 15 23:31:13 PDT 2022
Author: Fangrui Song
Date: 2022-08-16T08:30:06+02:00
New Revision: 095ea503ddc00db82a67f940f5ad7ecbf349a4fc
URL: https://github.com/llvm/llvm-project/commit/095ea503ddc00db82a67f940f5ad7ecbf349a4fc
DIFF: https://github.com/llvm/llvm-project/commit/095ea503ddc00db82a67f940f5ad7ecbf349a4fc.diff
LOG: [MCDwarf][test] Improve debug-prefix-map.s
(cherry picked from commit d561907f27d721558e4372990ca52a8284b7aafc)
Added:
Modified:
llvm/test/MC/ELF/debug-prefix-map.s
Removed:
################################################################################
diff --git a/llvm/test/MC/ELF/debug-prefix-map.s b/llvm/test/MC/ELF/debug-prefix-map.s
index 9fe4c9bf176e8..7f47632e730d8 100644
--- a/llvm/test/MC/ELF/debug-prefix-map.s
+++ b/llvm/test/MC/ELF/debug-prefix-map.s
@@ -1,25 +1,49 @@
-// RUN: mkdir -p %t.foo
-// RUN: cp %s %t.foo/src.s
-// RUN: cd %t.foo
+# RUN: rm -rf %t.foo && mkdir %t.foo && cd %t.foo
+# RUN: cp %s %t.foo/src.s
-// 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 -g -dwarf-version=4 src.s -filetype=obj -o nomap.4.o
+# RUN: llvm-dwarfdump -v -debug-info -debug-line nomap.4.o | FileCheck --check-prefix=NO_MAP_V4 %s
+# RUN: llvm-mc -triple=x86_64 -g -dwarf-version=5 src.s -filetype=obj -o nomap.5.o
+# RUN: llvm-dwarfdump -v -debug-info -debug-line nomap.5.o | FileCheck --check-prefix=NO_MAP_V5 %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 -g -dwarf-version=4 src.s -filetype=obj -o map.4.o -fdebug-prefix-map=%t.foo=src_root
+# RUN: llvm-dwarfdump -v -debug-info -debug-line map.4.o | FileCheck --check-prefix=MAP_V4 %s
+# RUN: llvm-mc -triple=x86_64 -g -dwarf-version=5 src.s -filetype=obj -o map.5.o -fdebug-prefix-map=%t.foo=src_root
+# RUN: llvm-dwarfdump -v -debug-info -debug-line map.5.o | FileCheck --check-prefix=MAP_V5 %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
+# RUN: llvm-mc -triple=x86_64 -g -dwarf-version=4 %t.foo/src.s -filetype=obj -o mapabs.4.o -fdebug-prefix-map=%t.foo=/src_root
+# RUN: llvm-dwarfdump -v -debug-info -debug-line mapabs.4.o | FileCheck --check-prefix=MAPABS_V4 %s
+# RUN: llvm-mc -triple=x86_64 -g -dwarf-version=5 %t.foo/src.s -filetype=obj -o mapabs.5.o -fdebug-prefix-map=%t.foo=/src_root
+# RUN: llvm-dwarfdump -v -debug-info -debug-line mapabs.5.o | FileCheck --check-prefix=MAPABS_V5 %s
f:
nop
-// NO_MAP: DW_AT_comp_dir [DW_FORM_string] ("{{.*}}.foo")
+# NO_MAP_V4: DW_AT_comp_dir [DW_FORM_string] ("{{.*}}.foo")
+# NO_MAP_V4: file_names[ 1]:
+# NO_MAP_V4-NEXT: name: "src.s"
-// 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")
+# NO_MAP_V5: DW_AT_comp_dir [DW_FORM_string] ("{{.*}}.foo")
+# NO_MAP_V5: include_directories[ 0] = .debug_line_str[0x00000000] = "{{.*}}.foo"
-// 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")
+# MAP_V4: DW_AT_name [DW_FORM_string] ("src.s")
+# MAP_V4: DW_AT_comp_dir [DW_FORM_string] ("src_root")
+# MAP_V4: DW_AT_decl_file [DW_FORM_data4] ("src_root{{(/|\\)+}}src.s")
+# MAP_V4-NOT: .foo
+
+## FIXME DW_AT_decl_file and include_directories are not mapped
+# MAP_V5: DW_AT_name [DW_FORM_string] ("src.s")
+# MAP_V5: DW_AT_comp_dir [DW_FORM_string] ("src_root")
+# MAP_V5: DW_AT_decl_file [DW_FORM_data4] ("{{.*}}.foo{{(/|\\)+}}src.s")
+# MAP_V5: include_directories[ 0] = .debug_line_str[0x00000000] = "{{.*}}.foo"
+
+# MAPABS_V4: DW_AT_name [DW_FORM_string] ("src.s")
+# MAPABS_V4: DW_AT_comp_dir [DW_FORM_string] ("{{(/|\\)+}}src_root")
+# MAPABS_V4: DW_AT_decl_file [DW_FORM_data4] ("{{(/|\\)+}}src_root{{(/|\\)+}}src.s")
+# MAPABS_V4-NOT: .foo
+
+## FIXME DW_AT_decl_file and include_directories are not mapped
+# MAPABS_V5: DW_AT_name [DW_FORM_string] ("src.s")
+# MAPABS_V5: DW_AT_comp_dir [DW_FORM_string] ("{{(/|\\)+}}src_root")
+# MAPABS_V5: DW_AT_decl_file [DW_FORM_data4] ("{{.*}}.foo{{(/|\\)+}}src.s")
+# MAPABS_V5: include_directories[ 0] = .debug_line_str[0x00000000] = "{{.*}}.foo"
More information about the llvm-branch-commits
mailing list