File Index
Files and directories
Sign in
FILE

verifier_may_goto_2.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/verifier_may_goto_2.c C
 1// SPDX-License-Identifier: GPL-2.0
 2/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
 3
 4#include "bpf_misc.h"
 5#include "bpf_experimental.h"
 6
 7int gvar;
 8
 9SEC("raw_tp")
10__description("C code with may_goto 0")
11__success
12int may_goto_c_code(void)
13{
14	int i, tmp[3];
15
16	for (i = 0; i < 3 && can_loop; i++)
17		tmp[i] = 0;
18
19	for (i = 0; i < 3 && can_loop; i++)
20		tmp[i] = gvar - i;
21
22	for (i = 0; i < 3 && can_loop; i++)
23		gvar += tmp[i];
24
25	return 0;
26}
27
28char _license[] SEC("license") = "GPL";
~/ Read-only file preview.