| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-skip-if "Don't inline memset using neon instructions" { ! arm_tune_string_ops_prefer_neon } } */ |
| 3 |
/* { dg-options "-save-temps -Os -fno-inline" } */ |
| 4 |
/* { dg-add-options "arm_neon" } */ |
| 5 |
|
| 6 |
#include <string.h> |
| 7 |
#include <stdlib.h> |
| 8 |
|
| 9 |
#define LEN (100) |
| 10 |
short a[LEN]; |
| 11 |
void |
| 12 |
foo (void) |
| 13 |
{ |
| 14 |
memset (a, -1, 14); |
| 15 |
return; |
| 16 |
} |
| 17 |
|
| 18 |
void |
| 19 |
check (signed char *arr, int idx, int len, int v) |
| 20 |
{ |
| 21 |
int i; |
| 22 |
for (i = 0; i < idx; i++) |
| 23 |
if (arr[i] != v) |
| 24 |
abort (); |
| 25 |
|
| 26 |
for (i = idx; i < len; i++) |
| 27 |
if (arr[i] != 0) |
| 28 |
abort (); |
| 29 |
} |
| 30 |
|
| 31 |
int |
| 32 |
main(void) |
| 33 |
{ |
| 34 |
foo (); |
| 35 |
check ((signed char *)a, 14, sizeof (a), -1); |
| 36 |
|
| 37 |
return 0; |
| 38 |
} |
| 39 |
/* { dg-final { scan-assembler-not "bl?\[ \t\]*memset" { target { arm_little_endian && arm_neon } } } } */ |
| 40 |
/* { dg-final { scan-assembler "vst1" { target { arm_little_endian && arm_neon } } } } */ |