Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-33.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4
5 #include <stdarg.h>
6 #include "tree-vect.h"
7
8 #define N 16
9 struct test {
10 char ca[N];
11 };
12
13 extern struct test s;
14
15 __attribute__ ((noinline))
16 int main1 ()
17 {
18 int i;
19
20 for (i = 0; i < N; i++)
21 {
22 s.ca[i] = 5;
23 }
24
25 /* check results: */
26 #pragma GCC novector
27 for (i = 0; i < N; i++)
28 {
29 if (s.ca[i] != 5)
30 abort ();
31 }
32
33 return 0;
34 }
35
36 int main (void)
37 {
38 return main1 ();
39 }
40
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
42 /* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { { ! vect64 } || vect_multiple_sizes } } xfail { ! vect_unaligned_possible } } } } */
43 /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target { vector_alignment_reachable && { vect64 && {! vect_multiple_sizes} } } } } } */
44 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { {! vector_alignment_reachable} || {! vect64} } && {! vect_hw_misalign} } } } } */
45 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */