selftests/bpf: add CO-RE relocs ptr-as-array tests
authorAndrii Nakryiko <andriin@fb.com>
Wed, 7 Aug 2019 21:39:59 +0000 (14:39 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 7 Aug 2019 21:43:49 +0000 (14:43 -0700)
commitd698f9dbdbed036ef28a96cd34a1b5d7fe58750e
tree5d0831c3929b34b89e9eb44d5415040765302f16
parent9654e2ae908eb0d51b0b79c7c50df0754ed38edd
selftests/bpf: add CO-RE relocs ptr-as-array tests

Add test validating correct relocation handling for cases where pointer
to something is used as an array. E.g.:

  int *ptr = ...;
  int x = ptr[42];

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/progs/btf__core_reloc_ptr_as_arr.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_ptr_as_arr___diff_sz.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/core_reloc_types.h
tools/testing/selftests/bpf/progs/test_core_reloc_ptr_as_arr.c [new file with mode: 0644]