]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/vect/vect-80-big-array.c
testsuite: auto-wipe dump files
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / vect / vect-80-big-array.c
1 /* { dg-require-effective-target vect_float } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 128
7
8 float fa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9 float fb[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11
12 /* Check handling of accesses for which the "initial condition" -
13 the expression that represents the first location accessed - is
14 more involved than just an ssa_name. */
15
16 volatile int y = 0;
17
18 __attribute__ ((noinline)) int
19 main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
20 {
21 int i;
22 float *q = pb + 4;
23 for (i = 0; i < N; i++)
24 {
25 fb[i] = i;
26 fc[i] = 0.5+i;
27 if (y)
28 abort ();
29 }
30 for (; i < N+4; i++)
31 {
32 fb[i] = i;
33 if (y)
34 abort ();
35 }
36
37 for (i = 0; i < N; i++)
38 {
39 pa[i] = q[i] * pc[i];
40 }
41
42 for (i = 0; i < N; i++)
43 {
44 if (pa[i] != q[i] * pc[i])
45 abort ();
46 }
47
48 return 0;
49 }
50
51
52 int main (void)
53 {
54 check_vect ();
55
56 main1 (fa, fb, fc);
57
58 return 0;
59 }
60
61 /* For targets that don't support misaligned loads we version for the
62 all three accesses (peeling to align the store will not force the
63 two loads to be aligned). */
64
65 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
66 /* Uncomment when this testcase gets vectorized again:
67 dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
68 dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
69 dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } }
70 */