aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/test_libbpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/bpf/test_libbpf.c')
-rw-r--r--tools/lib/bpf/test_libbpf.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/lib/bpf/test_libbpf.c b/tools/lib/bpf/test_libbpf.c
new file mode 100644
index 000000000000..f0eb2727b766
--- /dev/null
+++ b/tools/lib/bpf/test_libbpf.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
+#include "libbpf.h"
+#include "bpf.h"
+#include "btf.h"
+
+/* do nothing, just make sure we can link successfully */
+
+int main(int argc, char *argv[])
+{
+ /* libbpf.h */
+ libbpf_set_print(NULL);
+
+ /* bpf.h */
+ bpf_prog_get_fd_by_id(0);
+
+ /* btf.h */
+ btf__new(NULL, 0);
+
+ return 0;
+}