Debian Codegraph @

gcc/testsuite/gcc.target/bpf/core-builtin-2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O0 -dA -gbtf -mco-re -masm=normal" } */
3
4 struct S {
5 int a;
6 union {
7 int _unused;
8 int b;
9 char c;
10 } u[4];
11 };
12
13 struct S foo;
14
15 #define _(x) (__builtin_preserve_access_index (x))
16
17 void func (void)
18 {
19 /* 0:1:3:2 */
20 char *x = __builtin_preserve_access_index (&foo.u[3].c);
21
22 *x = 's';
23 }
24
25 /* { dg-final { scan-assembler-times "\[\t \]0x4000002\[\t \]+\[^\n\]*btt_info" 1 } } */
26 /* { dg-final { scan-assembler-times "ascii \"0:1:3:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
27 /* { dg-final { scan-assembler-times "bpfcr_type" 1 } } */