Debian Codegraph @

gcc/testsuite/gcc.target/arm/pr120351.c

raw
1 /* { dg-do assemble } */
2 /* { dg-require-effective-target arm_neon_ok } */
3 /* { dg-add-options arm_neon } */
4 /* { dg-additional-options "-O2" } */
5
6
7 typedef struct A
8 {
9 int f1;
10 } A;
11
12 __inline void ref (A* x)
13 {
14 __atomic_fetch_add(&x->f1, 1, 0);
15 }
16
17 typedef struct B
18 {
19 A *d;
20 int *ptr;
21 } B;
22
23 void insertOne (B*, B*);
24
25 void init (B *);
26 __inline void copy (B *p, B *q)
27 {
28 p->d = q->d;
29 p->ptr = q->ptr;
30 ref (p->d);
31 }
32
33 __inline void emplace(B* x)
34 {
35 B dummy;
36 B _tmp;
37 init (&dummy);
38 copy (&_tmp, &dummy);
39 insertOne(x, &_tmp);
40 }
41
42 void testing ()
43 {
44 B test;
45 init (&test);
46 emplace(&test);
47 }