[llvm] [llvm-size] Fix --totals option for Mach-O files (PR #157904)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 16 01:23:21 PDT 2025
================
@@ -16,6 +16,16 @@
# CHECK-NEXT: [[FILE2]]
# CHECK-NEXT: 18 36 72 126 7e (TOTALS)
+# RUN: yaml2obj %s --docnum=3 -o %t-macho.o
+# RUN: yaml2obj %s --docnum=4 -o %t-macho2.o
+# RUN: llvm-size --totals %t-macho.o %t-macho2.o \
+# RUN: | FileCheck %s --check-prefix=MACHO-CHECK --strict-whitespace --match-full-lines --implicit-check-not={{.}} -DFILE1=%t-macho.o -DFILE2=%t-macho2.o
----------------
jh7370 wrote:
```suggestion
# RUN: llvm-size --totals %t-macho.o %t-macho2.o | \
# RUN: FileCheck %s --check-prefix=MACHO-CHECK --strict-whitespace \
# RUN: --match-full-lines --implicit-check-not={{.}} -DFILE1=%t-macho.o -DFILE2=%t-macho2.o
```
Two things: a) the FileCheck command should be split over multiple lines, since it's getting quite long; b) I have a slight preference for continuing lines as in the above suggestion, since the trailing `| \` indicates the next line continues, but as a new command (i.e. there are no more args to come), while the indentation on the second line indicates it is a follow-on command from the previous one).
https://github.com/llvm/llvm-project/pull/157904
More information about the llvm-commits
mailing list