[committed] Remove compromised sh test
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-88.c
blob4071580e4bf066ad802327e8b9e703c1e10e235a
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0 -fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 __attribute__ ((noinline))
10 int main1 (int n, int *a)
12 int i, j, k;
13 int b[N];
15 for (i = 0; i < n; i++)
17 for (j = 0; j < n; j++)
19 k = i + n;
20 a[j] = k;
22 b[i] = k;
26 #pragma GCC novector
27 for (j = 0; j < n; j++)
28 if (a[j] != i + n - 1)
29 abort();
31 #pragma GCC novector
32 for (j = 0; j < n; j++)
33 if (b[j] != j + n)
34 abort();
36 return 0;
39 int main (void)
41 int a[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
43 check_vect ();
45 main1 (N, a+1);
46 main1 (0, a+1);
47 main1 (1, a+1);
48 main1 (2, a+1);
49 main1 (N-1, a+1);
51 return 0;
54 /* Fails for targets that don't vectorize PLUS (e.g alpha). */
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
56 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
57 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */