[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:19 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:
+# CHECK-DEFAULT-FILE: Available features for this target:
+
+# RUN: llvm-objdump --triple=arm --mcpu=help %t 2>&1 \
+# RUN: | FileCheck %s --check-prefix=CHECK-TRIPLE-PRIORITY
+
+# CHECK-TRIPLE-PRIORITY: Available CPUs for this target:
+# CHECK-TRIPLE-PRIORITY: Available features for this target:
+# CHECK-TRIPLE-PRIORITY: arm
----------------
jh7370 wrote:
This will require an arm target to be registered to work, just like the default behaviour for this test requires x86. You'll either need to add/update the REQUIRES tag at the start of the file, or spin the test case off into a separate file. I softly prefer the latter (`mattr-mcpu-triple-help.test`), because it means the original test will still run on machines with only x86 configured.
https://github.com/llvm/llvm-project/pull/165661
More information about the llvm-commits
mailing list