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>
This commit is contained in:
Andrii Nakryiko 2019-08-07 14:39:59 -07:00 • committed by Alexei Starovoitov
commit d698f9dbdb
5 changed files with 69 additions and 0 deletions