Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-vectorize-1.c
bloba0e0496d3455dc48de8a4508dbbb1d154b838327
1 /* { dg-do compile } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-tree-loop-distribute-patterns -fno-vect-cost-model -fdump-tree-vect-details" } */
4 /* { dg-require-effective-target powerpc_vsx } */
6 /* Taken from vect/vect-align-1.c. */
7 #include <stdlib.h>
8 #include <stdarg.h>
10 /* Compile time known misalignment. Cannot use loop peeling to align
11 the store. */
13 #define N 16
15 struct foo {
16 char x;
17 int y[N];
18 } __attribute__((packed));
20 int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
22 __attribute__ ((noinline)) int
23 main1 (struct foo * __restrict__ p)
25 int i;
27 for (i = 0; i < N; i++)
29 p->y[i] = x[i];
32 /* check results: */
33 for (i = 0; i < N; i++)
35 if (p->y[i] != x[i])
36 abort ();
38 return 0;
42 int main (void)
44 int i;
45 struct foo *p = malloc (2*sizeof (struct foo));
47 main1 (p);
48 return 0;
51 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
52 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */