Debian Codegraph @

gcc/testsuite/g++.target/powerpc/pr102024.C

raw
1 // PR target/102024
2 // { dg-do compile { target powerpc_elfv2 } }
3 // { dg-options "-O2" }
4
5 // Test that a zero-width bit field in an otherwise homogeneous aggregate
6 // generates a psabi warning and passes arguments in GPRs.
7
8 // { dg-final { scan-assembler-times {\mstd\M} 4 } }
9
10 struct a_thing
11 {
12 double x;
13 double y;
14 double z;
15 int : 0;
16 double w;
17 };
18
19 double
20 foo (a_thing a) // { dg-message "ELFv2 parameter passing for an argument containing zero-width bit fields but that is otherwise a homogeneous aggregate was corrected in GCC 12" }
21 {
22 return a.x * a.y + a.z - a.w;
23 }