Debian Codegraph @

gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #if VECTOR_BITS > 128
8 #define N (VECTOR_BITS * 2 / 8)
9 #else
10 #define N 32
11 #endif
12
13 struct {
14 char ca[N];
15 char cb[N];
16 } s;
17
18 __attribute__ ((noinline))
19 int main1 ()
20 {
21 int i;
22
23 for (i = 0; i < N; i++)
24 {
25 s.cb[i] = 3*i;
26 __asm__ volatile ("");
27 }
28
29 for (i = 0; i < N; i++)
30 {
31 s.ca[i] = s.cb[i];
32 }
33
34 /* check results: */
35 #pragma GCC novector
36 for (i = 0; i < N; i++)
37 {
38 if (s.ca[i] != s.cb[i])
39 abort ();
40 }
41
42 return 0;
43 }
44
45 int main (void)
46 {
47 check_vect ();
48
49 return main1 ();
50 }
51
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */