aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_cpp.cpp
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-12-11 09:58:16 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-12-11 09:58:16 -0300
commit761bfc33dd7504de951aa7b9db27a3cc5df1fde6 (patch)
tree93f4ac22fb206fe214998a599f4d2ea0214be70a /tools/testing/selftests/bpf/test_cpp.cpp
parentMerge tag 'perf-urgent-for-mingo-5.5-20191205' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (diff)
parentMerge tag 'for-5.5-rc1-kconfig-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux (diff)
downloadlinux-dev-761bfc33dd7504de951aa7b9db27a3cc5df1fde6.tar.xz
linux-dev-761bfc33dd7504de951aa7b9db27a3cc5df1fde6.zip
Merge remote-tracking branch 'torvalds/master' into perf/urgent
To pick up BPF fixes to allow a clean 'make -C tools/perf build-test': 7c3977d1e804 libbpf: Fix sym->st_value print on 32-bit arches 1fd450f99272 libbpf: Fix up generation of bpf_helper_defs.h Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/testing/selftests/bpf/test_cpp.cpp')
-rw-r--r--tools/testing/selftests/bpf/test_cpp.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_cpp.cpp b/tools/testing/selftests/bpf/test_cpp.cpp
new file mode 100644
index 000000000000..f0eb2727b766
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_cpp.cpp
@@ -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;
+}