summaryrefslogtreecommitdiff
path: root/tests/language-feature/generics/prebound-variadic-pack.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-17 08:55:57 -0800
committerGitHub <noreply@github.com>2025-01-17 08:55:57 -0800
commit3666c66e26f90b10031578e9c8b8f2ea118aecf9 (patch)
treea9564b3becf23d17b3183d97689c126819ffce9e /tests/language-feature/generics/prebound-variadic-pack.slang
parentdfb369e87dd7638e84efe8feb9e7069e5238b44c (diff)
Fix prebound parameter pack - argument list matching logic. (#6111)
* Fix prebound parameter pack - argument list matching logic. * Move tests. * Fix.
Diffstat (limited to 'tests/language-feature/generics/prebound-variadic-pack.slang')
-rw-r--r--tests/language-feature/generics/prebound-variadic-pack.slang28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/language-feature/generics/prebound-variadic-pack.slang b/tests/language-feature/generics/prebound-variadic-pack.slang
new file mode 100644
index 000000000..01edce8f9
--- /dev/null
+++ b/tests/language-feature/generics/prebound-variadic-pack.slang
@@ -0,0 +1,28 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+struct Set<each T>
+{
+ Tuple<expand each T> data;
+ void f(expand each T v){}
+ void h<each U>(U x){}
+ void g(expand each T d)
+ {
+ //CHECK-NOT: ([[# @LINE+1]]): error
+ f(expand each d); // OK
+
+ //CHECK-NOT: ([[# @LINE+1]]): error
+ h(54); // OK, specializing free-form parameter U.
+
+ //CHECK: ([[# @LINE+1]]): error
+ f(); // error, cannot call f without arguments.
+
+ //CHECK: ([[# @LINE+1]]): error
+ f(5); // error, cannot call f with different type pack.
+ }
+}
+
+[numthreads(1,1,1)]
+void computeMain()
+{
+ Set<float> v;
+} \ No newline at end of file