Debian Codegraph @

gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O0 -dA -gbtf -mco-re -masm=normal" } */
3
4 struct T {
5 int a;
6 int b;
7 struct U {
8 int c;
9 struct V {
10 int d;
11 int e[4];
12 int f;
13 } v;
14 } u;
15 };
16
17 void func (struct T * foo)
18 {
19 /* Access string: "0:2:1:1:3" */
20 int *x;
21 int *y;
22 struct U *tmp;
23 __builtin_preserve_access_index (({
24 x = &(foo->u.v.e[3]);
25 tmp = &(foo->u);
26 }));
27 y = __builtin_preserve_access_index(tmp ? 0 : &(tmp->v.f));
28
29 *x = 17;
30 if (y != 0)
31 *y = 16;
32 }
33
34 /* { dg-final { scan-assembler-times "ascii \"0:2:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
35 /* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
36 /* { dg-final { scan-assembler-times "ascii \"0:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
37 /* { dg-final { scan-assembler-times "bpfcr_type" 3 } } */