-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[HLSL][NFC] Move all resource tests under CodeGenHLSL\resources #152035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hekota
wants to merge
1
commit into
llvm:main
Choose a base branch
from
hekota:move-resource-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+0
−33
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) ChangesAlso removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl. Full diff: https://github.com/llvm/llvm-project/pull/152035.diff 23 Files Affected:
diff --git a/clang/test/CodeGenHLSL/buffer-array-operator.hlsl b/clang/test/CodeGenHLSL/buffer-array-operator.hlsl
deleted file mode 100644
index f65cdbb43e27b..0000000000000
--- a/clang/test/CodeGenHLSL/buffer-array-operator.hlsl
+++ /dev/null
@@ -1,33 +0,0 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
-
-// XFAIL: *
-// Resource indexing will be properly implemented in llvm/llvm-project#95956
-
-const RWBuffer<float> In;
-RWBuffer<float> Out;
-
-void fn(int Idx) {
- Out[Idx] = In[Idx];
-}
-
-// This test is intended to verify reasonable code generation of the subscript
-// operator. In this test case we should be generating both the const and
-// non-const operators so we verify both cases.
-
-// Non-const comes first.
-// CHECK: ptr @"??A?$RWBuffer@M@hlsl@@QBAAAMI@Z"
-// CHECK: %this1 = load ptr, ptr %this.addr, align 4
-// CHECK-NEXT: %h = getelementptr inbounds nuw %"class.hlsl::RWBuffer", ptr %this1, i32 0, i32 0
-// CHECK-NEXT: %0 = load ptr, ptr %h, align 4
-// CHECK-NEXT: %1 = load i32, ptr %Idx.addr, align 4
-// CHECK-NEXT: %arrayidx = getelementptr inbounds nuw float, ptr %0, i32 %1
-// CHECK-NEXT: ret ptr %arrayidx
-
-// Const comes next, and returns the pointer instead of the value.
-// CHECK: ptr @"??A?$RWBuffer@M@hlsl@@QAAAAMI@Z"
-// CHECK: %this1 = load ptr, ptr %this.addr, align 4
-// CHECK-NEXT: %h = getelementptr inbounds nuw %"class.hlsl::RWBuffer", ptr %this1, i32 0, i32 0
-// CHECK-NEXT: %0 = load ptr, ptr %h, align 4
-// CHECK-NEXT: %1 = load i32, ptr %Idx.addr, align 4
-// CHECK-NEXT: %arrayidx = getelementptr inbounds nuw float, ptr %0, i32 %1
-// CHECK-NEXT: ret ptr %arrayidx
diff --git a/clang/test/CodeGenHLSL/builtins/AppendStructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/AppendStructuredBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/AppendStructuredBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/AppendStructuredBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/ByteAddressBuffers-constructors.hlsl b/clang/test/CodeGenHLSL/resources/ByteAddressBuffers-constructors.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/ByteAddressBuffers-constructors.hlsl
rename to clang/test/CodeGenHLSL/resources/ByteAddressBuffers-constructors.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/ConsumeStructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/ConsumeStructuredBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/ConsumeStructuredBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/ConsumeStructuredBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-constructor-opt.hlsl b/clang/test/CodeGenHLSL/resources/RWBuffer-constructor-opt.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RWBuffer-constructor-opt.hlsl
rename to clang/test/CodeGenHLSL/resources/RWBuffer-constructor-opt.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl b/clang/test/CodeGenHLSL/resources/RWBuffer-constructor.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl
rename to clang/test/CodeGenHLSL/resources/RWBuffer-constructor.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/RWBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/RWBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl b/clang/test/CodeGenHLSL/resources/RWBuffer-subscript.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl
rename to clang/test/CodeGenHLSL/resources/RWBuffer-subscript.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RWStructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/RWStructuredBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RWStructuredBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/RWStructuredBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/RasterizerOrderedStructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/RasterizerOrderedStructuredBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/RasterizerOrderedStructuredBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/RasterizerOrderedStructuredBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffer-elementtype.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl
rename to clang/test/CodeGenHLSL/resources/StructuredBuffer-elementtype.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-constructors.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-constructors.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/StructuredBuffers-constructors.hlsl
rename to clang/test/CodeGenHLSL/resources/StructuredBuffers-constructors.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl
rename to clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl
rename to clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-subscripts.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-subscripts.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/builtins/StructuredBuffers-subscripts.hlsl
rename to clang/test/CodeGenHLSL/resources/StructuredBuffers-subscripts.hlsl
diff --git a/clang/test/CodeGenHLSL/cbuffer.hlsl b/clang/test/CodeGenHLSL/resources/cbuffer.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/cbuffer.hlsl
rename to clang/test/CodeGenHLSL/resources/cbuffer.hlsl
diff --git a/clang/test/CodeGenHLSL/cbuffer_align.hlsl b/clang/test/CodeGenHLSL/resources/cbuffer_align.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/cbuffer_align.hlsl
rename to clang/test/CodeGenHLSL/resources/cbuffer_align.hlsl
diff --git a/clang/test/CodeGenHLSL/cbuffer_and_namespaces.hlsl b/clang/test/CodeGenHLSL/resources/cbuffer_and_namespaces.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/cbuffer_and_namespaces.hlsl
rename to clang/test/CodeGenHLSL/resources/cbuffer_and_namespaces.hlsl
diff --git a/clang/test/CodeGenHLSL/cbuffer_with_packoffset.hlsl b/clang/test/CodeGenHLSL/resources/cbuffer_with_packoffset.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/cbuffer_with_packoffset.hlsl
rename to clang/test/CodeGenHLSL/resources/cbuffer_with_packoffset.hlsl
diff --git a/clang/test/CodeGenHLSL/cbuffer_with_static_global_and_function.hlsl b/clang/test/CodeGenHLSL/resources/cbuffer_with_static_global_and_function.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/cbuffer_with_static_global_and_function.hlsl
rename to clang/test/CodeGenHLSL/resources/cbuffer_with_static_global_and_function.hlsl
diff --git a/clang/test/CodeGenHLSL/default_cbuffer.hlsl b/clang/test/CodeGenHLSL/resources/default_cbuffer.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/default_cbuffer.hlsl
rename to clang/test/CodeGenHLSL/resources/default_cbuffer.hlsl
diff --git a/clang/test/CodeGenHLSL/default_cbuffer_with_layout.hlsl b/clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/default_cbuffer_with_layout.hlsl
rename to clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
diff --git a/clang/test/CodeGenHLSL/resource-bindings.hlsl b/clang/test/CodeGenHLSL/resources/resource-bindings.hlsl
similarity index 100%
rename from clang/test/CodeGenHLSL/resource-bindings.hlsl
rename to clang/test/CodeGenHLSL/resources/resource-bindings.hlsl
|
bob80905
approved these changes
Aug 4, 2025
llvm-beanz
approved these changes
Aug 5, 2025
s-perron
approved these changes
Aug 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl.