1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 #include <iostream>
3 #include <bpf/libbpf.h>
4 #include <bpf/bpf.h>
5 #include <bpf/btf.h>
6 #include "test_core_extern.skel.h"
7 
8 /* do nothing, just make sure we can link successfully */
9 
10 static void dump_printf(void *ctx, const char *fmt, va_list args)
11 {
12 }
13 
14 int main(int argc, char *argv[])
15 {
16 	struct btf_dump_opts opts = { };
17 	struct test_core_extern *skel;
18 	struct btf *btf;
19 
20 	/* libbpf.h */
21 	libbpf_set_print(NULL);
22 
23 	/* bpf.h */
24 	bpf_prog_get_fd_by_id(0);
25 
26 	/* btf.h */
27 	btf = btf__new(NULL, 0);
28 	btf_dump__new(btf, dump_printf, nullptr, &opts);
29 
30 	/* BPF skeleton */
31 	skel = test_core_extern__open_and_load();
32 	test_core_extern__destroy(skel);
33 
34 	std::cout << "DONE!" << std::endl;
35 
36 	return 0;
37 }
38