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

#include <string.h>

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

/* We should see three unaligned word loads and store pairs, one unaligned
   ldrh/strh pair, and an ldrb/strb pair.  Sanity check that.  */

/* { dg-final { scan-assembler-times "@ unaligned" 8 } } */
/* { 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 } } */