1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2020 Facebook */
5 #include <bpf/bpf_helpers.h>
8 __attribute__ ((noinline))
9 int f1(struct __sk_buff *skb)
14 int f3(int, struct __sk_buff *skb);
16 __attribute__ ((noinline))
17 int f2(int val, struct __sk_buff *skb)
19 return f1(skb) + f3(val, (void *)&val); /* type mismatch */
22 __attribute__ ((noinline))
23 int f3(int val, struct __sk_buff *skb)
25 return skb->ifindex * val;
29 __failure __msg("expected pointer to ctx, but got PTR")
30 int global_func5(struct __sk_buff *skb)
32 return f1(skb) + f2(2, skb) + f3(3, skb);