summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
blob: 359dd8feb907f07f4cca8b4237a7f40337ae7f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Verify that we generate movua to copy unaligned memory regions to
   32-bit-aligned addresses.  */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 2 } } */

#ifdef __SH4A__
#include <string.h>

struct s { int i; char a[10], b[10]; } x;
int f() {
  memcpy(x.a, x.b, 10);
}
#else
asm ("movua.l\t+");
asm ("movua.l\t+");
#endif