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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 02:44:32 PST 2025


jh7370 wrote:

> I propose updating the test cases to follow this structure:
> 
> > --mcpu=help + --disassemble + objects specified + other dump options, no --triple:
> > a. mcpu help should be printed for the targets specified (as current behaviour).
> > b. Disassembly should be printed for specified objects (as current behaviour).
> > c. Other dump options should be printed for specified objects.
> > --mcpu=help + --disassemble + no objects specified + other dump options, no --triple
> > a. Same as 1. but with a.out treated as the object, if it exists.
> > b. If a.out doesn't exist, we want some form of error, because we don't know which target to dump the mcpu help text for.
> > --mcpu=help + --disassemble + no objects specified + other dump options, --triple
> > a. As 2. but target derived from --triple option value.
> > b. If a.out doesn't exist, print MCPU help derived from --triple and don't emit an error.
> > --mcpu=help + no --disassemble
> > a. Same as above cases, depending on other option values (--disassemble is not required to print MCPU help text).
> > b. If no other dump options specified, exit success and no errors.
> 
> Would this be clearer?

My outline was intended as inspiration for the set of tests needed. It doesn't necessarily mean that they should match them one-t-one, as long as the behaviours described are covered (there may be other cases that need covering too, but I don't specifically know what those are off the top of my head). The set of tests you've got are a good starting point, but might need further expansion, if any of the described behaviours aren't covered.

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


More information about the llvm-commits mailing list