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>
This commit is contained in:
Alexei Starovoitov 2019-08-02 16:23:40 -07:00
commit 8c30396074
2 changed files with 33 additions and 0 deletions