selftests/bpf: add loop test 5
authorAlexei Starovoitov <ast@kernel.org>
Fri, 2 Aug 2019 23:23:40 +0000 (16:23 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Aug 2019 15:20:31 +0000 (08:20 -0700)
commit8c30396074c131765b19eb3cb7ff764a4f2f2913
tree46e44350fd17175e1ab9b8394c980c6e6fe89300
parenta78d0dbec712999ecd2f800eea0f62dc93867a78
selftests/bpf: add loop test 5

Add a test with multiple exit conditions.
It's not an infinite loop only when the verifier can properly track
all math on variable 'i' through all possible ways of executing this loop.

barrier()s are needed to disable llvm optimization that combines multiple
branches into fewer branches.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
tools/testing/selftests/bpf/progs/loop5.c [new file with mode: 0644]