summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/while-in-generic.slang23
-rw-r--r--tests/bugs/while-in-generic.slang.expected.txt4
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/bugs/while-in-generic.slang b/tests/bugs/while-in-generic.slang
new file mode 100644
index 000000000..ea34238f5
--- /dev/null
+++ b/tests/bugs/while-in-generic.slang
@@ -0,0 +1,23 @@
+//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute
+struct Context
+{
+ int genFunc<TGenType>(TGenType t)
+ {
+ int i = 0;
+ while (true)
+ {
+ i++;
+ if (i > 5) break;
+ }
+ return i;
+ }
+};
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+RWStructuredBuffer<int> outputBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ Context c;
+ outputBuffer[dispatchThreadID.x] = c.genFunc<int>(5);
+} \ No newline at end of file
diff --git a/tests/bugs/while-in-generic.slang.expected.txt b/tests/bugs/while-in-generic.slang.expected.txt
new file mode 100644
index 000000000..4c6d5911b
--- /dev/null
+++ b/tests/bugs/while-in-generic.slang.expected.txt
@@ -0,0 +1,4 @@
+6
+6
+6
+6 \ No newline at end of file