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