[llvm-branch-commits] [llvm] [DirectX] Add support for `remove-section` of `DXContainer` for `llvm-objcopy` (PR #153246)
James Henderson via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 14 03:04:48 PDT 2025
================
@@ -0,0 +1,300 @@
+## Tests that the RTS0 (root signature) part is correctly removed from the
+## copied DXContainer.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --remove-section=RTS0 %t %t.out
+# RUN: obj2yaml %t.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
+## FileSize = 1984 - 24 (RTS0 content) - 4 (1 part offset) - 8 (1 part header)
+## = 1948
+## CHECK: FileSize: 1948
+ FileSize: 1984
+## CHECK: PartCount: 6
+ PartCount: 7
+ PartOffsets: [ 60, 1792, 1808, 1836, 1852, 1868, 1900 ]
+Parts:
+## CHECK-NOT: RTS0
----------------
jh7370 wrote:
Actually, it doesn't matter, I believe, but you should still use `#` for FileCheck and lit directives and `##` for comments, for readability purposes.
https://github.com/llvm/llvm-project/pull/153246
More information about the llvm-branch-commits
mailing list