libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-72.c
blob72052fd305e6eacce50ee0d4ab96beb2dafbfc00
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-require-effective-target vect_int } */
4 /* { dg-add-options bind_pic_locally } */
6 #include <stdarg.h>
7 #include "tree-vect.h"
9 #define N 128
11 /* unaligned load. */
13 char ia[N];
14 char ib[N+1];
16 __attribute__ ((noinline))
17 int main1 ()
19 int i;
21 for (i=0; i < N+1; i++)
23 ib[i] = i;
24 if (i%3 == 0)
25 ib[i] = 5;
26 /* Avoid vectorization. */
27 __asm__ volatile ("" : : : "memory");
30 for (i = 1; i < N+1; i++)
32 ia[i-1] = ib[i];
35 /* check results: */
36 #pragma GCC novector
37 for (i = 1; i <= N; i++)
39 if (ia[i-1] != ib[i])
40 abort ();
43 return 0;
46 int main (void)
48 check_vect ();
50 return main1 ();
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
54 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
55 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
56 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */