summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs/gh-357.slang38
-rw-r--r--tests/bugs/gh-357.slang.expected.txt4
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/bugs/gh-357.slang b/tests/bugs/gh-357.slang
new file mode 100644
index 000000000..be2ba95ed
--- /dev/null
+++ b/tests/bugs/gh-357.slang
@@ -0,0 +1,38 @@
+//TEST(compute):COMPARE_COMPUTE:
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:type AssocImpl
+
+
+RWStructuredBuffer<float> outputBuffer;
+
+interface IBase
+{
+ float getVal();
+};
+
+interface IAssoc
+{
+ associatedtype TBase : IBase;
+};
+
+struct BaseImpl : IBase
+{
+ float getVal() { return 1.0; }
+};
+
+struct AssocImpl : IAssoc
+{
+ typedef BaseImpl TBase;
+};
+
+__generic_param T : IAssoc;
+
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ uint tid = dispatchThreadID.x;
+ T.TBase base;
+ float rs = base.getVal();
+ outputBuffer[tid] = rs;
+}
diff --git a/tests/bugs/gh-357.slang.expected.txt b/tests/bugs/gh-357.slang.expected.txt
new file mode 100644
index 000000000..cc5e55ab6
--- /dev/null
+++ b/tests/bugs/gh-357.slang.expected.txt
@@ -0,0 +1,4 @@
+3F800000
+3F800000
+3F800000
+3F800000