summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-10 03:49:25 -0800
committerGitHub <noreply@github.com>2024-12-10 19:49:25 +0800
commitb0dfb1aef2cd5483f59b858c8921707174ffdf2d (patch)
treeea6fad9c0cfbbb4348c86917e57bd25bac6c0e42 /tests
parent945d8dd3c4cea58f3d9f36e8fa123137f64e180e (diff)
Don't emit a warning when implicit casting from known in-range int lit to half. (#5814)
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/half-coercion.slang10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/bugs/half-coercion.slang b/tests/bugs/half-coercion.slang
new file mode 100644
index 000000000..43a12cf89
--- /dev/null
+++ b/tests/bugs/half-coercion.slang
@@ -0,0 +1,10 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK-NOT: warning
+
+RWStructuredBuffer<half> output;
+[numthreads(1,1,1)]
+void computeMain()
+{
+ output[0] = 0; // coercion from 0 to half should not result in a warning.
+} \ No newline at end of file