summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
authorYong He <yonghe@google.com>2019-01-30 14:35:07 -0800
committerYong He <yonghe@google.com>2019-01-30 14:35:50 -0800
commit8286737741474a866c8c804070da11cb91710801 (patch)
tree9eb466c4f70b64e125bdddce53073dab2530b6e9 /tests/bugs
parent685a811e3d4405c4619e974e3610902d621efee7 (diff)
Fixing IR-lowering not properly registering func decl
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