i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-103.c
blob72d71322aa781301f69cee5328456377744dfb5d
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks --param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
5 #include <stdlib.h>
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #if VECTOR_BITS > 256
10 #define NINTS (VECTOR_BITS / 32)
11 #else
12 #define NINTS 8
13 #endif
15 #define N (NINTS + 1)
17 struct extraction
19 int a[N];
20 int b[N];
23 static int a[N] = {1,2,3,4,5,6,7,8,9};
24 static int b[N] = {17,24,7,0,2,3,4,31,82};
26 __attribute__ ((noinline))
27 int main1 (int x, int y) {
28 int i;
29 struct extraction *p;
30 p = (struct extraction *) malloc (sizeof (struct extraction));
32 for (i = 0; i < N; i++)
34 p->a[i] = a[i];
35 p->b[i] = b[i];
36 asm volatile ("" ::: "memory");
39 /* Vectorizable: distance > VF. */
40 for (i = 0; i < N; i++)
41 *((int *)p + x + i) = *((int *)p + x + i + NINTS);
43 /* check results: */
44 if (p->a[0] != a[N - 1])
45 abort ();
46 #pragma GCC novector
47 for (i = 1; i < N; i++)
48 if (p->a[i] != b[i - 1])
49 abort ();
51 return 0;
54 int main (void)
56 check_vect ();
58 return main1 (0, N);
61 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
62 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */