[llvm] [DirectX] Add `extract-section` to `llvm-objcopy` and implement it for `DXContainer` (PR #154804)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 4 02:14:12 PDT 2025
================
@@ -0,0 +1,306 @@
+## Tests that a separate DXContainer is created for the RTS0 (root signature)
+## part, specified with --extract-section specified
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy %t --extract-section=RTS0=%t.rts0.out
+# RUN: obj2yaml %t.rts0.out | FileCheck %s
+
+## The DXContainer described below was generated with:
+
+## `clang-dxc -T cs_6_7 test.hlsl /Fo temp.dxo`
+## `obj2yaml temp.dxo`
+
+## ``` test.hlsl
+## [RootSignature("")]
+## [numthreads(1,1,1)]
+## void main() {}
+## ```
+
+--- !dxcontainer
+Header:
+ Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
+ Version:
+ Major: 1
+ Minor: 0
+# CHECK: FileSize: 68
----------------
jh7370 wrote:
I don't think it makes sense to intermingle the `CHECK` with the YAML in this context, since the new object is pretty unrelated. It just makes it harder to find the CHECKs in the file.
I also feel like you should have more testing of the other YAML fields, to show they're correct for the new object.
Also, I have no idea if this makes sense for DXContainer parts, but is it worth checking that the content of the extracted part is correct?
https://github.com/llvm/llvm-project/pull/154804
More information about the llvm-commits
mailing list