summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/gh-3825.slang23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bugs/gh-3825.slang b/tests/bugs/gh-3825.slang
new file mode 100644
index 000000000..1feadb588
--- /dev/null
+++ b/tests/bugs/gh-3825.slang
@@ -0,0 +1,23 @@
+
+// Emit 0xFFFF as the stride value for the unsized array
+
+//TEST:SIMPLE(filecheck=CHECK): -entry fragment -stage fragment -emit-spirv-directly -target spirv-assembly -emit-spirv-directly
+struct Descriptors {
+ uint count;
+ uint array[];
+}
+
+struct Context {
+ Descriptors *descriptors;
+}
+
+[[vk::binding(0)]] ConstantBuffer<Context> context;
+
+// Dummy entry point.
+[shader("fragment")]
+float4 fragment(): SV_Target
+{
+ return float4(float(context.descriptors[0].array[0]), 1., 1., 1.);
+}
+
+// CHECK: OpDecorate %_ptr_PhysicalStorageBuffer__runtimearr_uint ArrayStride 65535