btf: do not use the CHAR `encoding' bit for BTF
Contrary to CTF and our previous expectations, as per [1], turns out
that in BTF:
1) The `encoding' field in integer types shall not be treated as a
bitmap, but as an enumerated, i.e. these bits are exclusive to each
other.
2) The CHAR bit in `encoding' shall _not_ be set when emitting types
for char nor `unsigned char'.
Consequently this patch clears the CHAR bit before emitting the
variable part of BTF integral types. It also updates the testsuite
accordingly, expanding it to check for BOOL bits.
[1] https://lore.kernel.org/bpf/
a73586ad-f2dc-0401-1eba-
2004357b7edf@fb.com/T/#t
gcc/ChangeLog:
* btfout.cc (output_asm_btf_vlen_bytes): Do not use the CHAR
encoding bit in BTF.
gcc/testsuite/ChangeLog:
* gcc.dg/debug/btf/btf-int-1.c: Do not check for char bits in
bti_encoding and check for bool bits.