summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-02 22:28:02 -0800
committerGitHub <noreply@github.com>2024-02-02 22:28:02 -0800
commit14764896c34b230a5563f48d8b8e565de2f3aa10 (patch)
tree2f105d3f6222103f458054f1cd38e280b6fb52b4 /tests/diagnostics
parentc15e7ade4e27e1649d5b98f5854e9e52bb9e60ae (diff)
Capability type checking. (#3530)
* Capability type checking. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/discard-in-compute.slang13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/diagnostics/discard-in-compute.slang b/tests/diagnostics/discard-in-compute.slang
new file mode 100644
index 000000000..e530881bd
--- /dev/null
+++ b/tests/diagnostics/discard-in-compute.slang
@@ -0,0 +1,13 @@
+//TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry main -profile cs_6_1
+void test()
+{
+ discard; // This should lead to `test` having `fragment` capability requirement.
+}
+
+[shader("compute")]
+[numthreads(1,1,1)]
+void main()
+{
+ // CHECK: error 36107
+ test(); // compute shader cannot call `test` that require capabiltiy `fragment`.
+}