[PATCH] D90013: [llvm-objdump] - Rewrite malformed-archives.test to use YAML descriptions.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 27 03:16:26 PDT 2020
jhenderson added inline comments.
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:6
+## Check we report an error when unable to read the size field on an archive as an integer.
+## Check two cases: when the first member is valid, but the second is not and vice versa.
----------------
"and vice versa" implies the second case is valid (whilst the first isn't), which isn't actually true.
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:10
+# RUN: not llvm-objdump --macho --archive-headers %t.libbogus1a.a 2>&1 | \
+# RUN: FileCheck -check-prefix=BOGUS1 -DVAL='1%' -DOFFSET=8 %s
----------------
Nit. Same below.
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:14-16
+# RUN: FileCheck -check-prefix=BOGUS1 -DVAL=10% -DOFFSET=68 %s
+# BOGUS1: .a': truncated or malformed archive (characters in size field in archive header are not all decimal numbers: '[[VAL]]' for archive member header at offset [[OFFSET]])
----------------
Here and throughout, we should probably check the name in the error, message, right?
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:45-46
+--- !Arch
+## It is the content based on an arbitrary valid named member. All fields except the first one ("Name")
+## are dropped, what makes the archive member to be truncated, but still allows to print its name.
+Content: "666f6f2e632020202020202020202020" ## "foo.c "
----------------
I had trouble understanding the original comment, so I've suggested an alternative.
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:49
-# RUN: not llvm-objdump --macho --archive-headers \
-# RUN: %p/Inputs/libbogus8.a \
-# RUN: 2>&1 | FileCheck -check-prefix=bogus8 %s
+## Check we report an error when terminator characters in archive member are not the correct "`\n" values.
+
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:75
+
+## Check we report an error when members long name length characters after
+## the "#1/" are not all decimal numbers.
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:88
-# bogus9: libbogus9.a(<file index: 0>): truncated or malformed archive (long name offset characters after the '/' are not all decimal numbers: '&a25*' for archive member header at offset 94)
+## Check we report an error when members long name length characters extends past the end of the archive.
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:126
+
+## Check we report an error when characters in UID field in archive header are not all decimal numbers.
+
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:139
+## Check we report an error when characters in GID field in archive header are not all decimal numbers.
+
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:152
+## Check we report an error when characters in AccessMode field in archive header are not all decimal numbers.
+
----------------
================
Comment at: llvm/test/tools/llvm-objdump/malformed-archives.test:165
+
+## Check we report an error when characters in LastModified field in archive header are not all decimal numbers.
----------------
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90013/new/
https://reviews.llvm.org/D90013
More information about the llvm-commits
mailing list