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 #define N 16 8 9 int a[N]; 10 11 __attribute__ ((noinline)) main1(int n)12int main1 (int n) 13 { 14 int i, j, k; 15 int b[N]; 16 17 for (i = 0; i < n; i++) 18 { 19 for (j = 0; j < n; j++) 20 { 21 k = i + n; 22 a[j] = k; 23 } 24 b[i] = k; 25 } 26 27 28 for (j = 0; j < n; j++) 29 if (a[j] != i + n - 1) 30 abort(); 31 32 for (i = 0; i < n; i++) 33 if (b[i] != i + n) 34 abort(); 35 36 return 0; 37 } 38 main(void)39int main (void) 40 { 41 check_vect (); 42 43 main1 (N); 44 main1 (0); 45 main1 (1); 46 main1 (2); 47 main1 (N-1); 48 49 return 0; 50 } 51 52 /* Fails for targets that don't vectorize PLUS (e.g alpha). */ 53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ 54 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ 55 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ 56