[llvm] [llvm-size] Fix --totals option for Mach-O files (PR #157904)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 01:09:53 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 -DFILE1=%t-macho.o -DFILE2=%t-macho2.o
----------------
jh7370 wrote:

Add `--strict-whitespace`, `--match-full-lines`, and `--implicit-check-not={{*}}`.

This will ensure the output matches exactly the expected output, including formatting. You'll need to tweak the check patterns below, since the leading whitespace is considered significant in this context.

https://github.com/llvm/llvm-project/pull/157904


More information about the llvm-commits mailing list