google / clspv

Clspv is a compiler for OpenCL C to Vulkan compute shaders
Apache License 2.0
607 stars 88 forks source link

printf does not handle "\0" #1371

Closed rjodinchr closed 2 months ago

rjodinchr commented 3 months ago

https://compiler-explorer.com/z/Thv1cjGr9

The following kernel does not generate any nodes for "\0":

__kernel void test_kernel()
{
    printf("%s", "\0");
    printf("%s", "test");
}
dneto0 commented 2 months ago

This causes the test_printf conformance test to fail because has a case like "foo\0foo"

https://github.com/KhronosGroup/OpenCL-CTS/blob/070052c890c83053c5243e32b5bec8b84b04344d/test_conformance/printf/util_printf.cpp#L749

Rekt3421 commented 2 months ago

taking a look at this now.