Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printf does not handle "\0" #1371

Closed
rjodinchr opened this issue Jun 21, 2024 · 2 comments · Fixed by #1384
Closed

printf does not handle "\0" #1371

rjodinchr opened this issue Jun 21, 2024 · 2 comments · Fixed by #1384
Assignees
Labels

Comments

@rjodinchr
Copy link
Collaborator

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
Copy link
Collaborator

dneto0 commented Jul 18, 2024

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
Copy link
Collaborator

taking a look at this now.

dneto0 added a commit to dneto0/clspv that referenced this issue Jul 18, 2024
alan-baker pushed a commit that referenced this issue Jul 19, 2024
* Support printf string args with nul

Add a test

Fixed: #1371

* Update test/printf/printf_string_64bit_ptr.ll

The metadata strings have NUL in them now too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants