aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c
blob: b16834786a191f7d8afeaf0f05eae02c9b8dd188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* { dg-do run { target aarch64*-*-* } } */
/* { dg-options "-O2 --save-temps -fno-inline" } */
/* { dg-require-effective-target aarch64_little_endian } */

extern void abort (void);

typedef struct bitfield
{
  unsigned short eight1: 8;
  unsigned short four: 4;
  unsigned short eight2: 8;
  unsigned short seven: 7;
  unsigned int sixteen: 16;
} bitfield;

bitfield
bfxil (bitfield a)
{
  /* { dg-final { scan-assembler "bfxil\tx\[0-9\]+, x\[0-9\]+, 16, 8" } } */
  a.eight1 = a.eight2;
  return a;
}

int
main (void)
{
  static bitfield a;
  bitfield b;

  a.eight1 = 9;
  a.eight2 = 57;
  b = bfxil (a);

  if (b.eight1 != a.eight2)
    abort ();

  return 0;
}

/* { dg-final { cleanup-saved-temps } } */