testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-3.c
blob04b144c869fc2a8f8be91a8252387e09d7fca2f2
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-add-options double_vectors } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #if VECTOR_BITS > 128
10 #define N (VECTOR_BITS * 2 / 8)
11 #else
12 #define N 32
13 #endif
15 int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
16 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
17 short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
18 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
19 char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
20 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
22 __attribute__ ((noinline))
23 int main1 (int n, int * __restrict__ pib,
24 short * __restrict__ psb,
25 char * __restrict__ pcb)
27 int i;
28 int ia[N];
29 short sa[N];
30 char ca[N];
32 /* Multiple types with different sizes, used in independent
33 computations. Vectorizable. The loads are misaligned. */
34 for (i = 0; i < n; i++)
36 ia[i] = pib[i];
37 sa[i] = psb[i];
38 ca[i] = pcb[i];
41 /* check results: */
42 #pragma GCC novector
43 for (i = 0; i < n; i++)
45 if (ia[i] != pib[i]
46 || sa[i] != psb[i]
47 || ca[i] != pcb[i])
48 abort ();
51 return 0;
54 int main (void)
56 check_vect ();
58 main1 (N, ib, sb, cb);
59 main1 (N-3, ib, sb, &cb[2]);
60 return 0;
63 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
64 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
65 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */