summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-20 09:28:13 -0700
committerGitHub <noreply@github.com>2024-10-20 09:28:13 -0700
commit307315a7305e76529837fd1cdb677f534d5f539b (patch)
treeba39e96ba2e9b3d62d1213aab2f1cc54febe451a /tests/bugs
parent9936178dd3efb026bfa142512a2bf061d7a75ab5 (diff)
Properly check switch case. (#5341)
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/gh-5321.slang17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/bugs/gh-5321.slang b/tests/bugs/gh-5321.slang
new file mode 100644
index 000000000..6bb1de1a7
--- /dev/null
+++ b/tests/bugs/gh-5321.slang
@@ -0,0 +1,17 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK: error {{.*}} compile-time constant
+
+uniform uint FillType_Solid = 0u;
+
+[shader("compute")]
+float cs(uniform uint x)
+ : SV_Target
+{
+ switch (x)
+ {
+ case FillType_Solid:
+ return 0.0;
+ }
+ return 0.0;
+} \ No newline at end of file