1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2021 Facebook */
3#include "vmlinux.h"
4#include <bpf/bpf_helpers.h>
5#include <bpf/bpf_tracing.h>
6
7#if __has_attribute(btf_type_tag)
8#define __tag1 __attribute__((btf_type_tag("tag1")))
9#define __tag2 __attribute__((btf_type_tag("tag2")))
10volatile const bool skip_tests = false;
11#else
12#define __tag1
13#define __tag2
14volatile const bool skip_tests = true;
15#endif
16
17struct btf_type_tag_test {
18 int __tag1 * __tag1 __tag2 *p;
19} g;
20
21SEC("fentry/bpf_fentry_test1")
22int BPF_PROG(sub, int x)
23{
24 return 0;
25}
26

source code of linux/tools/testing/selftests/bpf/progs/btf_type_tag.c