llvm-size falls back to printing in Berkeley format, if --format=darwin is specified and a non-Mach-O object has been provided. However, it does not print the input filename when it should:
Before -
(base) xgupta@archlinux ~/llvm/llvm-project/build (main*) $ llvm-size ~/hello.o --format=darwin
text data bss dec hex filename 291 0 0 291 123 %
After -
(base) xgupta@archlinux ~/llvm/llvm-project/build (main*) $ bin/llvm-size ~/hello.o --format=darwin
text data bss dec hex filename 291 0 0 291 123 /home/xgupta/hello.o
Fix #42316
It might be worth adding {{$}} to the end of this line. This will prevent FileCheck from matching successfully, if there's garbage after the filename.