Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr69946.c

raw
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc_elfv2 } } */
3 /* { dg-options "-O2" } */
4
5 /* This used to generate a rotate:DI by 44, with mask 0xf00, which is
6 implemented using a rlwinm instruction. We used to write 44 for the
7 shift count there; it should be 12. */
8
9 struct A
10 {
11 int a : 4;
12 int : 2;
13 int b : 2;
14 int : 2;
15 int c : 2;
16 int d : 1;
17 int e;
18 };
19 struct B
20 {
21 int a : 4;
22 } *a;
23 void bar (struct A);
24
25 void
26 foo (void)
27 {
28 struct B b = a[0];
29 struct A c;
30 c.a = b.a;
31 c.b = 1;
32 c.c = 1;
33 c.d = 0;
34 bar (c);
35 }
36
37 /* { dg-final { scan-assembler-not {(?n)rlwinm.*,44,20,23} } } */