summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/memset-inline-9.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/arm/memset-inline-9.c')
-rw-r--r--gcc/testsuite/gcc.target/arm/memset-inline-9.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/memset-inline-9.c b/gcc/testsuite/gcc.target/arm/memset-inline-9.c
new file mode 100644
index 00000000000..be9323aae51
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/memset-inline-9.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-skip-if "Don't inline memset using neon instructions on cortex-a9" { *-*-* } { "-mcpu=cortex-a9" } { "" } } */
+/* { dg-skip-if "Don't inline memset using neon instructions on cortex-a9" { *-*-* } { "-mtune=cortex-a9" } { "" } } */
+/* { dg-options "-save-temps -Os -fno-inline" } */
+/* { dg-add-options "arm_neon" } */
+
+#include <string.h>
+#include <stdlib.h>
+
+#define LEN (100)
+short a[LEN];
+void
+foo (void)
+{
+ memset (a, -1, 14);
+ return;
+}
+
+void
+check (signed char *arr, int idx, int len, int v)
+{
+ int i;
+ for (i = 0; i < idx; i++)
+ if (arr[i] != v)
+ abort ();
+
+ for (i = idx; i < len; i++)
+ if (arr[i] != 0)
+ abort ();
+}
+
+int
+main(void)
+{
+ foo ();
+ check ((signed char *)a, 14, sizeof (a), -1);
+
+ return 0;
+}
+/* { dg-final { scan-assembler-not "bl?\[ \t\]*memset" { target { arm_little_endian && arm_neon } } } } */
+/* { dg-final { scan-assembler "vst1" { target { arm_little_endian && arm_neon } } } } */
+/* { dg-final { cleanup-saved-temps } } */