| 1 |
/* { dg-do run { target vect_cmdline_needed } } */ |
| 2 |
/* { dg-options "-O2 -fno-tree-loop-distribute-patterns -ftree-vectorize -fdump-tree-vect-details -fno-vect-cost-model" } */ |
| 3 |
/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */ |
| 4 |
/* The IBM Z backend sets the min-vect-loop-bound param to 2 to avoid |
| 5 |
awkward epilogue code generation in some cases. This line needs to |
| 6 |
be removed after finding an alternate way to fix this. */ |
| 7 |
/* { dg-additional-options "--param min-vect-loop-bound=0" { target { s390*-*-* } } } */ |
| 8 |
|
| 9 |
#include <stdlib.h> |
| 10 |
|
| 11 |
#define N 16 |
| 12 |
|
| 13 |
int main () |
| 14 |
{ |
| 15 |
struct { |
| 16 |
char ca[N]; |
| 17 |
} s; |
| 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 |
|
| 37 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* pru-*-* } } } } } */ |
| 38 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* pru-*-* } } } } } */ |