Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / arm / memset-inline-8.c
blobbcfe6404efaecb585a70596d359b3686c8a51950
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 -O2 -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;
40 /* { dg-final { scan-assembler-not "bl?\[ \t\]*memset" { target { arm_thumb2_ok } } } } */
41 /* { dg-final { scan-assembler "vst1" { target { arm_little_endian && arm_neon } } } } */
42 /* { dg-final { scan-assembler-not "vstr" { target { arm_little_endian && arm_neon } } } } */