[llvm] [ObjCopy][DX] Support for -dump-section flag (PR #159999)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 10:24:56 PDT 2025


================
@@ -0,0 +1,283 @@
+# RUN: yaml2obj %s -o %t.dxbc
+# RUN: llvm-objcopy --dump-section=DXIL=%t.bc %t.dxbc
+# RUN: llvm-dis %t.bc -o - | FileCheck %s --check-prefix=BITCODE
+# RUN: wc -c %t.bc | FileCheck %s --check-prefix=DXIL-SIZE
+
+## Verify that when dumping the DXIL part we get a valid bitcode file.
+# BITCODE: define void @main()
+## Verify the size of the bitcode data.
+# DXIL-SIZE: 1708
+
+## Dump the PSV0 part and verify its size.
+# RUN: llvm-objcopy --dump-section=PSV0=%t.psv0 %t.dxbc
+# RUN: wc -c %t.psv0 | FileCheck %s --check-prefix=PSV0-SIZE
+# PSV0-SIZE: 76
+--- !dxcontainer
----------------
jh7370 wrote:

Nit: I suggest adding a blank line between the last check and the YAML, to help clarify the YAML isn't tied to that specific case.

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


More information about the llvm-commits mailing list