summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/gl-33-ext.slang8
-rw-r--r--tests/bugs/gl-33.slang28
-rw-r--r--tests/bugs/gl-33.slang.expected.txt4
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/bugs/gl-33-ext.slang b/tests/bugs/gl-33-ext.slang
new file mode 100644
index 000000000..ae70cfaf0
--- /dev/null
+++ b/tests/bugs/gl-33-ext.slang
@@ -0,0 +1,8 @@
+// gl-33-ext.slang
+//TEST_IGNORE_FILE:
+
+struct A
+{
+ int state;
+ [mutating] int next() { return state; }
+};
diff --git a/tests/bugs/gl-33.slang b/tests/bugs/gl-33.slang
new file mode 100644
index 000000000..89cfa0aad
--- /dev/null
+++ b/tests/bugs/gl-33.slang
@@ -0,0 +1,28 @@
+// gl-33.slang
+//TEST(compute):COMPARE_COMPUTE:
+
+// Test for GitLab issue # 33
+
+import gl_33_ext;
+
+typedef A B;
+
+int test(int val)
+{
+ B b = { val };
+ return b.next();
+}
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+RWStructuredBuffer<int> gBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ uint tid = dispatchThreadID.x;
+
+ int val = tid;
+ val = test(val);
+
+ gBuffer[tid] = val;
+}
diff --git a/tests/bugs/gl-33.slang.expected.txt b/tests/bugs/gl-33.slang.expected.txt
new file mode 100644
index 000000000..bc856dafa
--- /dev/null
+++ b/tests/bugs/gl-33.slang.expected.txt
@@ -0,0 +1,4 @@
+0
+1
+2
+3