summaryrefslogtreecommitdiff
path: root/tests/current-bugs/generic/int-generic-param.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/current-bugs/generic/int-generic-param.slang')
-rw-r--r--tests/current-bugs/generic/int-generic-param.slang30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/current-bugs/generic/int-generic-param.slang b/tests/current-bugs/generic/int-generic-param.slang
new file mode 100644
index 000000000..ba743d0d3
--- /dev/null
+++ b/tests/current-bugs/generic/int-generic-param.slang
@@ -0,0 +1,30 @@
+//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
+
+/* A test around integer generic parameters.
+
+Fails with:
+
+.slang(7): error 30019: expected an expression of type 'int', got 'typeof(N)'
+ return N;
+ */
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+int getN<N : int>()
+{
+ return N;
+}
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int index = dispatchThreadID.x;
+
+ float4 values = { 1, 2, 3, 4 };
+
+ let val = getN<10>();
+
+ outputBuffer[index] = val;
+}
+