selftests/bpf: Add test for map_ptr arithmetic
authorYonghong Song <yhs@fb.com>
Tue, 8 Sep 2020 17:57:03 +0000 (10:57 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 9 Sep 2020 01:04:07 +0000 (18:04 -0700)
commite6054fc1f865ac46936a6b5517ae2d36554c94f8
tree5becefbbc55a9fdf4d430224f063c63eab8a2cec
parent7c6967326267bd5c0dded0a99541357d70dd11ac
selftests/bpf: Add test for map_ptr arithmetic

Change selftest map_ptr_kern.c with disabling inlining for
one of subtests, which will fail the test without previous
verifier change. Also added to verifier test for both
"map_ptr += scalar" and "scalar += map_ptr" arithmetic.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200908175703.2463721-1-yhs@fb.com
tools/testing/selftests/bpf/progs/map_ptr_kern.c
tools/testing/selftests/bpf/verifier/map_ptr.c