selftests: bpf: add tests for shifts by zero
authorLuke Nelson <lukenels@cs.washington.edu>
Sat, 29 Jun 2019 05:57:51 +0000 (22:57 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 3 Jul 2019 09:14:28 +0000 (11:14 +0200)
commitac8786c72eba67dfc8ae751a75c586289a1b9b1b
treeaa608db6bc66714bae269be435fd209eb5b96413
parent6fa632e719eec4d1b1ebf3ddc0b2d667997b057b
selftests: bpf: add tests for shifts by zero

There are currently no tests for ALU64 shift operations when the shift
amount is 0. This adds 6 new tests to make sure they are equivalent
to a no-op. The x32 JIT had such bugs that could have been caught by
these tests.

Cc: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luke Nelson <luke.r.nels@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/verifier/basic_instr.c