xref: /linux/tools/testing/selftests/bpf/progs/bpf_test_utils.h (revision ae28ed4578e6d5a481e39c5a9827f27048661fdd)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __BPF_TEST_UTILS_H__
3 #define __BPF_TEST_UTILS_H__
4 
5 #include <bpf/bpf_helpers.h>
6 #include "bpf_misc.h"
7 
8 /* Clobber as many native registers and stack slots as possible. */
9 static __always_inline void clobber_regs_stack(void)
10 {
11 	char tmp_str[] = "123456789";
12 	unsigned long tmp;
13 
14 	bpf_strtoul(tmp_str, sizeof(tmp_str), 0, &tmp);
15 	__sink(tmp);
16 }
17 
18 #endif
19