summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c
diff options
context:
space:
mode:
authorViktor Malik <vmalik@redhat.com>2025-06-26 08:08:30 +0200
committerAlexei Starovoitov <ast@kernel.org>2025-06-26 09:44:46 -0700
commita55b7d39328bc6de1131cb5496816129cab2728b (patch)
treea36239ec100f7304f12f5c462efa99323f01d6e2 /tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c
parente91370550f1fe6fa3b02e8bf9762e3dc0a02fcad (diff)
selftests/bpf: Allow macros in __retval
Allow macro expansion for values passed to the `__retval` and `__retval_unpriv` attributes. This is especially useful for testing programs which return various error codes. With this change, the code for parsing special literals can be made simpler, as the literals are defined via macros. The only exception is INT_MIN which expands to (-INT_MAX -1), which is not single number and cannot be parsed by strtol. So, we instead use a prefixed literal _INT_MIN in __retval and handle it separately (assign the expected return to INT_MIN). Also, strtol cannot handle the "ll" suffix so change the value of POINTER_VALUE from 0xcafe4all to 0xbadcafe. Signed-off-by: Viktor Malik <vmalik@redhat.com> Link: https://lore.kernel.org/r/a6c6b551ae0575351faa7b7a1df52f9341a5cbe8.1750917800.git.vmalik@redhat.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c')
0 files changed, 0 insertions, 0 deletions