[llvm] Add llvm-extract-bundle-entry to extend llvm-objcopy (PR #169386)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 00:50:13 PST 2026


================
@@ -0,0 +1,97 @@
+## Test llvm-extract-bundle-entry.
+
+# RUN: yaml2obj %s -o %t.elf
+# RUN: llvm-extract-bundle-entry file://%t.elf#offset=8192\&size=4048
+# RUN: llvm-objdump -d %t.elf-offset8192-size4048.co  | FileCheck %s --check-prefix=EXTRACT_BUNDLE_ENTRY
+# EXTRACT_BUNDLE_ENTRY:        s_load_dword s7, s[4:5], 0x24                              // 000000001900: C00201C2 00000024
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_load_dwordx4 s[0:3], s[4:5], 0x0                         // 000000001908: C00A0002 00000000
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_mov_b32_e32 v1, 0                                        // 000000001910: 7E020280
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_waitcnt lgkmcnt(0)                                       // 000000001914: BF8CC07F
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_and_b32 s4, s7, 0xffff                                   // 000000001918: 8604FF07 0000FFFF
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_mul_i32 s6, s6, s4                                       // 000000001920: 92060406
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_add_u32_e32 v0, s6, v0                                   // 000000001924: 68000006
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_lshlrev_b64 v[0:1], 2, v[0:1]                            // 000000001928: D28F0000 00020082
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_mov_b32_e32 v3, s3                                       // 000000001930: 7E060203
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_add_co_u32_e32 v2, vcc, s2, v0                           // 000000001934: 32040002
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_addc_co_u32_e32 v3, vcc, v3, v1, vcc                     // 000000001938: 38060303
+# EXTRACT_BUNDLE_ENTRY-NEXT:        global_load_dword v2, v[2:3], off                          // 00000000193C: DC508000 027F0002
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_mov_b32_e32 v3, s1                                       // 000000001944: 7E060201
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_add_co_u32_e32 v0, vcc, s0, v0                           // 000000001948: 32000000
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_addc_co_u32_e32 v1, vcc, v3, v1, vcc                     // 00000000194C: 38020303
+# EXTRACT_BUNDLE_ENTRY-NEXT:        global_load_dword v3, v[0:1], off                          // 000000001950: DC508000 037F0000
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_waitcnt vmcnt(0)                                         // 000000001958: BF8C0F70
+# EXTRACT_BUNDLE_ENTRY-NEXT:        v_add_u32_e32 v2, v3, v2                                   // 00000000195C: 68040503
+# EXTRACT_BUNDLE_ENTRY-NEXT:        global_store_dword v[0:1], v2, off                         // 000000001960: DC708000 007F0200
+# EXTRACT_BUNDLE_ENTRY-NEXT:        s_endpgm                                                   // 000000001968: BF810000
+
+# RUN: llvm-extract-bundle-entry -help 2>&1 | \
+# RUN:   FileCheck %s --check-prefix=EXTRACT_BUNDLE_ENTRY_HELP
+# RUN: not llvm-extract-bundle-entry 2>&1 | \
+# RUN:   FileCheck %s --check-prefix=EXTRACT_BUNDLE_ENTRY_HELP
+# EXTRACT_BUNDLE_ENTRY_HELP: OVERVIEW: llvm-extract-bundle-entry tool
+# EXTRACT_BUNDLE_ENTRY_HELP: USAGE: llvm-extract-bundle-entry URI
+# EXTRACT_BUNDLE_ENTRY_HELP: OPTIONS:
+# EXTRACT_BUNDLE_ENTRY_HELP-NEXT:  --Help URIs can be read from STDIN, one per line.
----------------
jh7370 wrote:

I don't think there's much benefit in checking the exact content for the help text. We don't usually do this for other options or tools, for example, because it's too prone to change as new options get added/wording gets improved etc. Sufficient is to show that the help option lists some of the common options.

Actually, the right place to check the help content and unknown option handling is https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-objcopy/tool-help-message.test anyway.

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


More information about the llvm-commits mailing list