From b0dfb1aef2cd5483f59b858c8921707174ffdf2d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 Dec 2024 03:49:25 -0800 Subject: Don't emit a warning when implicit casting from known in-range int lit to half. (#5814) Co-authored-by: Ellie Hermaszewska --- tests/bugs/half-coercion.slang | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/bugs/half-coercion.slang (limited to 'tests') 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 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 -- cgit v1.2.3