[PATCH] D138986: [AIX][BigArchive] Treat the archive is empty if the first child member offset is zero

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 13:37:36 PST 2022


DiggerLin added inline comments.


================
Comment at: llvm/test/Object/archive-big-malformed-first-member.test:2
+# Test reading an empty archive with first member's offset is not zero.
+# RUN: not llvm-ar tv %p/Inputs/aix-malformed-big-archive.a 2>&1 \
+# RUN:   | grep 'truncated or malformed archive'
----------------
DiggerLin wrote:
> I think you can generate the malform aix-malformed-big-archive.a   with following command in test case ( we do not need llvm/test/Object/Inputs/aix-malformed-big-archive.a)  
> 
> ```
> #RUN:  echo "<bigaf>" > %t.a
> #RUN:  echo "0                   0                 123                   0                   0                   0" >> %t.a
> #RUN:  %python -c "with open('%t.a', 'r+b') as input: input.truncate(128)"
> ```
there are some examples of using "printf" 
you can use 
find llvm/test/tools -name "*.test" | xargs grep "printf"

to get the example.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138986/new/

https://reviews.llvm.org/D138986



More information about the llvm-commits mailing list