2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / bfxil_1.c
blob0e683ea989e08a05ec1a93b3bc8f228e22145d09
1 /* { dg-do run { target aarch64*-*-* } } */
2 /* { dg-options "-O2 --save-temps -fno-inline" } */
3 /* { dg-require-effective-target aarch64_little_endian } */
5 extern void abort (void);
7 typedef struct bitfield
9 unsigned short eight1: 8;
10 unsigned short four: 4;
11 unsigned short eight2: 8;
12 unsigned short seven: 7;
13 unsigned int sixteen: 16;
14 } bitfield;
16 bitfield
17 bfxil (bitfield a)
19 /* { dg-final { scan-assembler "bfxil\tx\[0-9\]+, x\[0-9\]+, 16, 8" } } */
20 a.eight1 = a.eight2;
21 return a;
24 int
25 main (void)
27 static bitfield a;
28 bitfield b;
30 a.eight1 = 9;
31 a.eight2 = 57;
32 b = bfxil (a);
34 if (b.eight1 != a.eight2)
35 abort ();
37 return 0;