2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.target / arm / memset-inline-9.c
blobd9e0722f732112730183356cc5d23eaf9b873c32
1 /* { dg-do run } */
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" } */
6 #include <string.h>
7 #include <stdlib.h>
9 #define LEN (100)
10 short a[LEN];
11 void
12 foo (void)
14 memset (a, -1, 14);
15 return;
18 void
19 check (signed char *arr, int idx, int len, int v)
21 int i;
22 for (i = 0; i < idx; i++)
23 if (arr[i] != v)
24 abort ();
26 for (i = idx; i < len; i++)
27 if (arr[i] != 0)
28 abort ();
31 int
32 main(void)
34 foo ();
35 check ((signed char *)a, 14, sizeof (a), -1);
37 return 0;
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 } } } } */