This change adds tests specifically for --parent-recurse-depth, --quiet and -o. The test for -o found a typo in an error message which is also fixed in this change.
Details
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
50 ms | x64 debian > LLVM.tools/llvm-dwarfdump/X86::output.s |
Event Timeline
llvm/test/tools/llvm-dwarfdump/X86/output.s | ||
---|---|---|
4 | It looks that you have some typos in this test file which are causing testing failures. | |
7 | Ditto. | |
11 | Ditto. | |
llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s | ||
22 | I think the following yaml code is more readable than raw assembly code. What do you think? --- !ELF FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_EXEC Machine: EM_X86_64 DWARF: debug_abbrev: - Table: - Tag: DW_TAG_compile_unit Children: DW_CHILDREN_yes Attributes: - Attribute: DW_AT_producer Form: DW_FORM_string - Tag: DW_TAG_subprogram Children: DW_CHILDREN_yes Attributes: - Attribute: DW_AT_name Form: DW_FORM_string - Tag: DW_TAG_namespace Children: DW_CHILDREN_yes Attributes: - Attribute: DW_AT_name Form: DW_FORM_string - Tag: DW_TAG_base_type Children: DW_CHILDREN_no Attributes: - Attribute: DW_AT_name Form: DW_FORM_string debug_info: - Version: 4 Entries: - AbbrCode: 1 Values: - CStr: by_hand - AbbrCode: 2 Values: - CStr: main - AbbrCode: 3 Values: - CStr: test - AbbrCode: 4 Values: - CStr: int | |
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | ||
638 | I think it might be good to surround file names with single quotes '. e.g. Unable to open output file '/path/to/file': permission denied |
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | ||
---|---|---|
638 | Whilst you're changing this message, I'd also change Unable to unable, in line with the LLVM error message style policy. |
Changed parent_recurse_depth.s to use yaml rather than assembly, fixed typo of FileCheck and fixed the error message.
llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s | ||
---|---|---|
22 | Much better thanks. | |
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | ||
638 | I'd have to check if OutputFilename is empty or an error like unable to open output file '': no such file or directory can be output which looks strange IMHO . Would it better to leave it as is? |
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | ||
---|---|---|
638 | Sounds reasonable to me. Thanks! |
Hi,
The test is a bit fragile as it fails if "main" is somewhere in the path of the object file created, which is likely with the development branch being called main (I personally use 1 git worktree per branch) or with the use of the term "mainline". How about the following change to consume the file name?
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s b/llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s
index 2d573344191c..a63a918a865d 100644
- a/llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s
@@ -1,8 +1,10 @@
- RUN: yaml2obj %s -o %t.o
- RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 0 %t.o | FileCheck %s --check-prefix=ALL
- RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 1 %t.o | FileCheck %s --check-prefix=ONE
- RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 2 %t.o | FileCheck %s --check-prefix=TWO
- RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 3 %t.o | FileCheck %s --check-prefix=ALL
+# RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 0 %t.o | FileCheck %s --check-prefixes=COMMON,ALL^M
+# RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 1 %t.o | FileCheck %s --check-prefixes=COMMON,ONE^M
+# RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 2 %t.o | FileCheck %s --check-prefixes=COMMON,TWO^M
+# RUN: llvm-dwarfdump --debug-info=0x00000020 -p -parent-recurse-depth 3 %t.o | FileCheck %s --check-prefixes=COMMON,ALL^M
+^M
+# COMMON: .o: file format^M
It looks that you have some typos in this test file which are causing testing failures.