xref: /linux/tools/testing/selftests/bpf/progs/test_global_func17.c (revision b10fdeea8cf42c0d97b337e9e501c92da4389a03)
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include <vmlinux.h>
3 #include <bpf/bpf_helpers.h>
4 
5 __noinline int foo(int *p)
6 {
7 	return p ? (*p = 42) : 0;
8 }
9 
10 const volatile int i;
11 
12 SEC("tc")
13 int test_cls(struct __sk_buff *skb)
14 {
15 	return foo((int *)&i);
16 }
17