Add compile command to each testcase
[gcc-vect-testsuite.git] / pr43430-1.c
blob9eaa23cca8f464a6d2f340b548e6657051f62888
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 typedef int myint;
9 myint data_ch1[N + 1] =
10 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
11 myint data_ch2[N + 1] =
12 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
13 #define SUM 480
15 __attribute__ ((noinline)) int
16 foo (myint * s1, myint * s2, int stride)
18 int score = 0;
19 int x;
20 for (x = 0; x < N; x++)
21 score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
22 s1[x] + s2[x + stride] :
23 s2[x + stride]);
25 if (score != SUM)
26 abort ();
28 return 0;
31 int
32 main (void)
34 check_vect ();
35 return foo (data_ch1, data_ch2, 1);
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
39 /* { dg-final { cleanup-tree-dump "vect" } } */