Clang patch ([1]) added support for btf_decl_tag attributes with typedef
types. This patch added llvm support including dwarf generation.
For example, for typedef
typedef unsigned * __u __attribute__((btf_decl_tag("tag1")));
__u u;the following shows llvm-dwarfdump result:
0x00000033: DW_TAG_typedef
DW_AT_type (0x00000048 "unsigned int *")
DW_AT_name ("__u")
DW_AT_decl_file ("/home/yhs/work/tests/llvm/btf_tag/t.c")
DW_AT_decl_line (1)
0x0000003e: DW_TAG_LLVM_annotation
DW_AT_name ("btf_decl_tag")
DW_AT_const_value ("tag1")
0x00000047: NULL
[1] https://reviews.llvm.org/D110127
Outside of clang/test/Driver, tests should use %clang_cc1 to run the frontend directly instead of via the driver. This will require some minor adjustment to the command-line options, for example -target becomes -triple and -g generally becomes -debug-info-kind=limited.
Also, the x86_64 triple will do the wrong thing on a Windows host. You probably want %itanium_abi_triple there.