1 /* { dg-do run { target aarch64*-*-* } } */
2 /* { dg-options "-O2 --save-temps -fno-inline" } */
3 /* { dg-require-effective-target aarch64_big_endian } */
5 extern void abort (void);
7 typedef struct bitfield
9 unsigned short eight
: 8;
10 unsigned short four
: 4;
11 unsigned short five
: 5;
12 unsigned short seven
: 7;
13 unsigned int sixteen
: 16;
19 /* { dg-final { scan-assembler "bfi\tx\[0-9\]+, x\[0-9\]+, 56, 8" } } */
27 /* { dg-final { scan-assembler "bfi\tx\[0-9\]+, x\[0-9\]+, 43, 5" } } */
35 /* { dg-final { scan-assembler "movk\tx\[0-9\]+, 0x1d6b, lsl 16" } } */
43 /* { dg-final { scan-assembler "orr\tx\[0-9\]+, x\[0-9\]+, 272678883688448" } } */
51 /* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, -272678883688449" } } */
58 main (int argc
, char** argv
)
61 bitfield b
= bfi1 (a
);
62 bitfield c
= bfi2 (b
);
63 bitfield d
= movk (c
);
71 if (d
.sixteen
!= 7531)