1 /* Limit this test to selected targets with IEEE double, 8-byte long long,
2    supported 4x int vectors, 4-byte int.  */
3 /* { dg-do compile { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } */
4 /* { dg-options "-O3 -fdump-tree-optimized" } */
5 /* { dg-additional-options "-msse2" { target ia32 } } */
6 /* { dg-additional-options "-mvsx -maltivec" { target powerpc*-*-* } } */
7 
8 typedef int V __attribute__((__vector_size__ (16)));
9 #define N 1024
10 double d[N];
11 long long int l[N];
12 _Bool b[N];
13 _Complex double c[N];
14 V v[N];
15 
16 void
fd(void)17 fd (void)
18 {
19   int i;
20   for (i = 0; i < N; i++)
21     d[i] = 747708026454360457216.0;
22 }
23 
24 void
fl(void)25 fl (void)
26 {
27   int i;
28   for (i = 0; i < N; i++)
29     l[i] = 0x7c7c7c7c7c7c7c7cULL;
30 }
31 
32 void
fb(void)33 fb (void)
34 {
35   int i;
36   for (i = 0; i < N; i++)
37     b[i] = 1;
38 }
39 
40 void
fc(void)41 fc (void)
42 {
43   int i;
44   for (i = 0; i < N; i++)
45     c[i] = 747708026454360457216.0 + 747708026454360457216.0i;
46 }
47 
48 void
fv(void)49 fv (void)
50 {
51   int i;
52   for (i = 0; i < N; i++)
53     v[i] = (V) { 0x12121212, 0x12121212, 0x12121212, 0x12121212 };
54 }
55 
56 /* Look for
57   __builtin_memset (&d, 68, 8192);
58   __builtin_memset (&l, 124, 8192);
59   __builtin_memset (&b, 1, 1024);
60   __builtin_memset (&c, 68, 16384);
61   __builtin_memset (&v, 18, 16384); */
62 /* { dg-final { scan-tree-dump-times "memset ..d, 68, 8192.;" 1 "optimized" } } */
63 /* { dg-final { scan-tree-dump-times "memset ..l, 124, 8192.;" 1 "optimized" } } */
64 /* { dg-final { scan-tree-dump-times "memset ..b, 1, 1024.;" 1 "optimized" } } */
65 /* { dg-final { scan-tree-dump-times "memset ..c, 68, 16384.;" 1 "optimized" } } */
66 /* { dg-final { scan-tree-dump-times "memset ..v, 18, 16384.;" 1 "optimized" } } */
67