testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-109.c
blob63813dbdb39055038d44f34f1c5788ddf5f6b930
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0 -fdump-tree-optimized-details-blocks" } */
3 /* { dg-skip-if "" { vect_no_align } } */
4 /* { dg-require-effective-target vect_int } */
5 /* { dg-add-options bind_pic_locally } */
7 #include <stdarg.h>
8 #include "tree-vect.h"
10 #define N 32
12 short sa[N];
13 short sc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
15 short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
17 int ia[N];
18 int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
19 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
20 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
21 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
23 __attribute__ ((noinline))
24 int main1 (int n)
26 int i;
28 /* Multiple types with different sizes, used in idependent
29 copmutations. Vectorizable. */
30 for (i = 0; i < n; i++)
32 sa[i+2] = sb[i] + sc[i];
33 ia[i+1] = ib[i] + ic[i];
36 /* check results: */
37 #pragma GCC novector
38 for (i = 0; i < n; i++)
40 if (sa[i+2] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
41 abort ();
44 return 0;
47 int main2 (int n)
49 int i;
51 /* Multiple types with different sizes, used in idependent
52 copmutations. Vectorizable. */
53 for (i = 0; i < n; i++)
55 ia[i+1] = ib[i] + ic[i];
56 sa[i] = sb[i] + sc[i];
59 /* check results: */
60 #pragma GCC novector
61 for (i = 0; i < n; i++)
63 if (sa[i] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
64 abort ();
67 return 0;
71 int main (void)
73 check_vect ();
75 main1 (N-2);
76 main2 (N-1);
78 return 0;
81 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_element_align } } } */
82 /* { dg-final { scan-tree-dump-times "unsupported unaligned access" 2 "vect" { xfail vect_element_align } } } */
83 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */
85 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */