summaryrefslogtreecommitdiff
path: root/tests/cooperative-vector/subscript.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cooperative-vector/subscript.slang')
-rw-r--r--tests/cooperative-vector/subscript.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/cooperative-vector/subscript.slang b/tests/cooperative-vector/subscript.slang
new file mode 100644
index 000000000..1d41bec62
--- /dev/null
+++ b/tests/cooperative-vector/subscript.slang
@@ -0,0 +1,25 @@
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation -emit-spirv-directly
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
+
+// CHECK: type: int32_t
+// CHECK-NEXT: 2
+// CHECK-NEXT: 4
+// CHECK-NEXT: 6
+// CHECK-NEXT: 8
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<int32_t> outputBuffer;
+
+[numthreads(1, 1, 1)]
+void computeMain()
+{
+ CoopVec<int32_t, 4> vec;
+ vec[0] = 2;
+ vec[1] = vec[0]+2;
+ vec[2] = vec[1]+2;
+ vec[3] = vec[2]+2;
+
+ for(int i = 0; i < vec.getCount(); ++i)
+ outputBuffer[i] = vec[i];;
+}