2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-8a.c
blobdc742eb84fb11b56ecfd89205cdd34f54b5d9c52
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 26
8 __attribute__ ((noinline)) int main1 (short X)
9 {
10 signed char a[N];
11 short b[N];
12 int c[N];
13 short myX = X;
14 int i;
16 /* vectorization of induction with type conversions. */
17 for (i = 0; i < N; i++)
19 a[i] = (signed char)X;
20 b[i] = X;
21 c[i] = (int)X;
22 X++;
25 /* check results: */
26 for (i = 0; i < N; i++)
28 if (a[i] != (signed char)myX || b[i] != myX || c[i] != (int)myX++)
29 abort ();
32 return 0;
35 int main (void)
37 check_vect ();
39 return main1 (3);
42 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
43 /* { dg-final { cleanup-tree-dump "vect" } } */