Debian Codegraph @

gcc/testsuite/g++.target/aarch64/sve/pr121449.C

raw
1 /* PR target/121449 */
2 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
3 /* { dg-options "-O3 -save-temps" } */
4
5 struct example;
6
7 struct array {
8 unsigned length();
9 example *operator[](unsigned i) {
10 example **data = reinterpret_cast<example **>(this);
11 return data[i];
12 }
13 };
14
15 struct example {
16 int a[16];
17 bool is_even;
18 int version;
19 int count() { return is_even ? 2 : 1; }
20 void fun1(int, long);
21 void fun2(unsigned, unsigned);
22 void process(array &, array &);
23 };
24
25 bool found;
26
27 void example::process(array &a, array &b) {
28 for (unsigned i = 1; a.length(); i++) {
29 long total = 0;
30 for (unsigned k = 0; k <= i; k++) {
31 total += a[k]->count();
32 }
33 for (unsigned j = 0; j < i; j++) {
34 int major = b[j]->version;
35 if (found)
36 major += i;
37 fun1(i + 1, total);
38 fun2(j, major);
39 }
40 }
41 }
42
43 /* { dg-final { scan-assembler-not {\tld1b\t(z[0-9]+)\.d, p[0-7]/z, \[(z[0-9]+)\.d, #64\]} } } */
44