[llvm] [llvm-objdump] Add triple support to `mcpu=help` (PR #165661)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 25 00:57:16 PST 2025


================
@@ -14,3 +14,30 @@ FileHeader:
   Data:            ELFDATA2LSB
   Type:            ET_EXEC
   Machine:         EM_X86_64
+
+# RUN: cp %t a.out
+# RUN: llvm-objdump -d --mcpu=help 2>&1 \
+# RUN:   | FileCheck %s --check-prefix=CHECK-DEFAULT-FILE
+# RUN: rm a.out
+
+# CHECK-DEFAULT-FILE: Available CPUs for this target:
----------------
jh7370 wrote:

CHECK prefixes can be reused between FileCheck invocations. You can also combine multiple in a single FileCheck run, using --check-prefixes. I reckon in total, we could get away with the following between all test cases (including the existing one):

`CHECK-HELP` which checks the help titles are printed.
`CHECK-DISASM` which checks that x86-64 disassembly is printed (primarily for the original test case, but can (should?) also be used for the a.out case.
`CHECK-ARM` which checks that ARM help text is produced.
`NO-DISASM` which is the same as CHECK-DISASM, but you can add a `-NOT` suffix to the check pattern line to invert it and fail if disassembly is printed. You should use this in each case where disassembly is not expected.

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


More information about the llvm-commits mailing list