openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-46.c
blob016580e7a95f96810a0baaf4cb0c724a73a7af0d
1 /* { dg-require-effective-target vect_double } */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
4 #include "tree-vect.h"
6 double x[1024], y[1024];
8 void __attribute__((noipa)) foo()
10 for (int i = 0; i < 512; ++i)
12 x[2*i] = y[i];
13 x[2*i+1] = y[i];
17 void __attribute__((noipa)) bar()
19 for (int i = 0; i < 512; ++i)
21 x[2*i] = y[2*i];
22 x[2*i+1] = y[2*i];
26 void __attribute__((noipa)) baz()
28 for (int i = 0; i < 512; ++i)
30 x[2*i] = y[511-i];
31 x[2*i+1] = y[511-i];
35 void __attribute__((noipa)) boo()
37 for (int i = 0; i < 512; ++i)
39 x[2*i] = y[2*(511-i)];
40 x[2*i+1] = y[2*(511-i)];
44 int
45 main ()
47 check_vect ();
49 for (int i = 0; i < 1024; ++i)
51 x[i] = 0;
52 y[i] = i;
53 __asm__ volatile ("");
56 foo ();
57 #pragma GCC novector
58 for (int i = 0; i < 1024; ++i)
59 if (x[i] != y[i/2])
60 abort ();
62 for (int i = 0; i < 1024; ++i)
64 x[i] = 0;
65 __asm__ volatile ("");
68 bar ();
69 #pragma GCC novector
70 for (int i = 0; i < 1024; ++i)
71 if (x[i] != y[2*(i/2)])
72 abort ();
74 for (int i = 0; i < 1024; ++i)
76 x[i] = 0;
77 __asm__ volatile ("");
80 baz ();
81 #pragma GCC novector
82 for (int i = 0; i < 1024; ++i)
83 if (x[i] != y[511 - i/2])
84 abort ();
86 for (int i = 0; i < 1024; ++i)
88 x[i] = 0;
89 __asm__ volatile ("");
92 boo ();
93 #pragma GCC novector
94 for (int i = 0; i < 1024; ++i)
95 if (x[i] != y[2*(511 - i/2)])
96 abort ();
98 return 0;
101 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */