aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/unaligned-memcpy-2.c
blob: c7d24c9c5c3ebb4866f28707a08017f82c717319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-require-effective-target arm_unaligned } */
/* { dg-options "-O2" } */

#include <string.h>

char dest[16];

void aligned_dest (char *src)
{
  memcpy (dest, src, 15);
}

/* Expect a multi-word store for the main part of the copy, but subword
   loads/stores for the remainder.  */

/* { dg-final { scan-assembler-times "stmia" 1 } } */
/* { dg-final { scan-assembler-times "ldrh" 1 } } */
/* { dg-final { scan-assembler-times "strh" 1 } } */
/* { dg-final { scan-assembler-times "ldrb" 1 } } */
/* { dg-final { scan-assembler-times "strb" 1 } } */