aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c
new file mode 100644
index 000000000..b16834786
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/bfxil_1.c
@@ -0,0 +1,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 } } */