Debian Codegraph @

gcc/testsuite/g++.target/powerpc/pr94707-3.C

raw
1 // PR target/94707
2 // { dg-do compile { target powerpc_elfv2 } }
3 // { dg-options "-O2 -std=c++17" }
4 // Test that for all the calls in this testcase the C++17 empty base
5 // artificial fields and [[no_unique_address]] empty class non-static
6 // data members are ignored in the decision about passing homogeneous
7 // arguments.
8 // { dg-final { scan-assembler-times {(?n)^\s+lfs\s+(?:%f)?4,} 7 } }
9
10 struct X { };
11 struct Y { int : 0; };
12 struct Z { int : 0; Y y; };
13 struct U : public X { X q; };
14 struct A { float a, b, c, d; };
15 struct B : public X { float a, b, c, d; };
16 struct C : public Y { float a, b, c, d; };
17 struct D : public Z { float a, b, c, d; };
18 struct E : public U { float a, b, c, d; };
19 struct F { [[no_unique_address]] X x; float a, b, c, d; };
20 struct G { [[no_unique_address]] Y y; float a, b, c, d; };
21 struct H { [[no_unique_address]] Z z; float a, b, c, d; };
22 struct I { [[no_unique_address]] U u; float a, b, c, d; };
23 struct J { float a, b; [[no_unique_address]] X x; float c, d; };
24 struct K { float a, b; [[no_unique_address]] Y y; float c, d; };
25 struct L { float a, b; [[no_unique_address]] Z z; float c, d; };
26 struct M { float a, b; [[no_unique_address]] U u; float c, d; };
27 #define T(S, s) extern S s; extern void foo##s (S); int bar##s () { foo##s (s); return 0; }
28 // { dg-message "parameter passing for argument of type 'B' when C\\+\\+17 is enabled changed to match C\\+\\+14 in GCC 10.1" "" { target *-*-* } .-1 }
29 // { dg-message "parameter passing for argument of type 'C' when C\\+\\+17 is enabled changed to match C\\+\\+14 in GCC 10.1" "" { target *-*-* } .-2 }
30 // { dg-message "parameter passing for argument of type 'F' with '\\\[\\\[no_unique_address\\\]\\\]' members changed in GCC 10.1" "" { target *-*-* } .-3 }
31 // { dg-message "parameter passing for argument of type 'G' with '\\\[\\\[no_unique_address\\\]\\\]' members changed in GCC 10.1" "" { target *-*-* } .-4 }
32 // { dg-message "parameter passing for argument of type 'J' with '\\\[\\\[no_unique_address\\\]\\\]' members changed in GCC 10.1" "" { target *-*-* } .-5 }
33 // { dg-message "parameter passing for argument of type 'K' with '\\\[\\\[no_unique_address\\\]\\\]' members changed in GCC 10.1" "" { target *-*-* } .-6 }
34 T (A, a)
35 T (B, b)
36 T (C, c)
37 T (F, f)
38 T (G, g)
39 T (J, j)
40 T (K, k)