summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-28 22:46:56 -0800
committerGitHub <noreply@github.com>2025-02-28 22:46:56 -0800
commitdd9d24d29c4a9e05a4510eb9959fafa0ed36618b (patch)
tree240e2e4ecd8fc15fa835db4377670ec7fdf90e71 /tests/diagnostics
parent700c38ae7c16a49de7f720ae3b1940df5b2b4b33 (diff)
Allow partial specialization of existential arguments. (#6487)
* Allow partial specialization of existential arguments. * Fix. * Add test case for improved diagnostics. * Fix compile error. * Fix tests. * Fix. * Fix test. * Fix compile issue. * Fix typo. * Address comment.
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/interfaces/anyvalue-size-validation.slang.expected2
-rw-r--r--tests/diagnostics/resource-type-in-dynamic-dispatch.slang28
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/diagnostics/interfaces/anyvalue-size-validation.slang.expected b/tests/diagnostics/interfaces/anyvalue-size-validation.slang.expected
index f2000909b..e94651671 100644
--- a/tests/diagnostics/interfaces/anyvalue-size-validation.slang.expected
+++ b/tests/diagnostics/interfaces/anyvalue-size-validation.slang.expected
@@ -3,7 +3,7 @@ standard error = {
tests/diagnostics/interfaces/anyvalue-size-validation.slang(11): error 41011: type 'S' does not fit in the size required by its conforming interface.
struct S : IInterface
^
-tests/diagnostics/interfaces/anyvalue-size-validation.slang(11): note 41012: sizeof(S) is 12, limit is 8
+tests/diagnostics/interfaces/anyvalue-size-validation.slang(11): note: sizeof(S) is 12, limit is 8
}
standard output = {
}
diff --git a/tests/diagnostics/resource-type-in-dynamic-dispatch.slang b/tests/diagnostics/resource-type-in-dynamic-dispatch.slang
new file mode 100644
index 000000000..114eb800b
--- /dev/null
+++ b/tests/diagnostics/resource-type-in-dynamic-dispatch.slang
@@ -0,0 +1,28 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+// CHECK: type 'FooImpl' contains fields that cannot be packed into ordinary bytes for dynamic dispatch.
+interface IFoo
+{
+ float get();
+}
+
+export struct FooImpl : IFoo
+{
+ Texture2D t;
+ float get() { return 1.0; }
+}
+
+export struct FooImpl2 : IFoo
+{
+ float v;
+ float get() { return v; }
+}
+
+
+RWStructuredBuffer<float> outputBuffer;
+
+[numthreads(1,1,1)]
+void computeMain()
+{
+ IFoo f = createDynamicObject<IFoo>(0, 5);
+ outputBuffer[0] = f.get();
+} \ No newline at end of file