1 // SPDX-License-Identifier: GPL-2.0-only
2 #include <vmlinux.h>
3 #include <bpf/bpf_helpers.h>
4 #include "bpf_misc.h"
5 
foo(int * p)6 __noinline int foo(int *p)
7 {
8 	barrier_var(p);
9 	return p ? (*p = 42) : 0;
10 }
11 
12 const volatile int i;
13 
14 SEC("tc")
15 __failure __msg("Caller passes invalid args into func#1")
global_func17(struct __sk_buff * skb)16 int global_func17(struct __sk_buff *skb)
17 {
18 	return foo((int *)&i);
19 }
20