| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -save-temps" } */ |
| 3 |
|
| 4 |
#include <string.h> |
| 5 |
|
| 6 |
char src[17] __attribute__ ((aligned(8))) = "abcdefghijklmnop"; |
| 7 |
char result[17] __attribute__ ((aligned(8))) = {0}; |
| 8 |
|
| 9 |
void __attribute__ ((noinline,noclone)) aligned_src (char *dest) |
| 10 |
{ |
| 11 |
memcpy (dest, src, 15); |
| 12 |
} |
| 13 |
|
| 14 |
int main () |
| 15 |
{ |
| 16 |
int i; |
| 17 |
aligned_src (result+1); |
| 18 |
for (i = 0; i < 15; i++) |
| 19 |
if (result[i+1] != src[i]) |
| 20 |
__builtin_abort (); |
| 21 |
if (result[16] != 0) |
| 22 |
__builtin_abort (); |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
/* Check that we don't use any instructions that assume an aligned dest. */ |
| 27 |
/* { dg-final { scan-assembler-not {(stm(ia)?\tr[0-9]|strd\t.*\[r[0-9]|vstr)} } } */ |