summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_subprogs_unused.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-12-11 17:49:01 +0000
committerMark Brown <broonie@kernel.org>2020-12-11 17:49:01 +0000
commit3e98a021cc85e7d52acdd1eae8a988e975ec5bf9 (patch)
treececfac58b9550a602555a02a9d583ed0f3378b38 /tools/testing/selftests/bpf/progs/test_subprogs_unused.c
parent58f7553fa424fd0fd74e8b796d50c66014cebebe (diff)
parent2fee9583198eb97b5351feda7bd825e0f778385c (diff)
Merge remote-tracking branch 'spi/for-5.11' into spi-next
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_subprogs_unused.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_subprogs_unused.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_subprogs_unused.c b/tools/testing/selftests/bpf/progs/test_subprogs_unused.c
new file mode 100644
index 000000000000..bc49e050d342
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_subprogs_unused.c
@@ -0,0 +1,21 @@
+#include "vmlinux.h"
+#include <bpf/bpf_helpers.h>
+#include <bpf/bpf_core_read.h>
+
+const char LICENSE[] SEC("license") = "GPL";
+
+__attribute__((unused)) __noinline int unused1(int x)
+{
+ return x + 1;
+}
+
+static __attribute__((unused)) __noinline int unused2(int x)
+{
+ return x + 2;
+}
+
+SEC("raw_tp/sys_enter")
+int main_prog(void *ctx)
+{
+ return 0;
+}