summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-15 18:54:16 -0700
committerGitHub <noreply@github.com>2024-10-15 18:54:16 -0700
commitc97166aed29e0a224d49cec0b12503d1a10b52e0 (patch)
tree1894ff8a3b608d66f55f5f2bd47640e679e59e78 /tests/bugs
parent99a242eca78149a61c0521d319e96ededec7168d (diff)
Fix type checking on generic extensions. (#5316)
Add fcpw library to test suite.
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/gh-5140.slang33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/bugs/gh-5140.slang b/tests/bugs/gh-5140.slang
new file mode 100644
index 000000000..23d9b3a23
--- /dev/null
+++ b/tests/bugs/gh-5140.slang
@@ -0,0 +1,33 @@
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-d3d11 -output-using-type
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+
+public interface A<T: IFloat>
+{
+}
+
+public extension<T1: IFloat, a1 : A<T1>> a1
+{
+ void foo() {
+ outputBuffer[0] = 1.0;
+ }
+}
+
+RWStructuredBuffer<float> outputBuffer;
+struct S : A<float> {
+}
+
+void helper<T: IFloat, a : A<T>>(a a2)
+{
+ a2.foo();
+}
+
+// CHECK: 1
+
+[numthreads(1,1,1)]
+void computeMain()
+{
+ S a;
+ helper(a);
+} \ No newline at end of file