Add compile command to each testcase
[gcc-vect-testsuite.git] / wrapv-vect-reduc-2char.c
blob4b04a9d41c34db42f2c444fe0ac77350c29903db
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 #define DIFF 121
9 signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
10 signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
12 __attribute__ ((noinline))
13 void main1 (signed char x, signed char max_result, signed char min_result)
15 int i;
16 signed char diff = 2;
17 signed char max = x;
18 signed char min = x;
20 for (i = 0; i < N; i++) {
21 diff += (signed char)(b[i] - c[i]);
24 for (i = 0; i < N; i++) {
25 max = max < c[i] ? c[i] : max;
28 for (i = 0; i < N; i++) {
29 min = min > c[i] ? c[i] : min;
32 /* check results: */
33 if (diff != DIFF)
34 abort ();
35 if (max != max_result)
36 abort ();
37 if (min != min_result)
38 abort ();
41 int main (void)
43 check_vect ();
45 main1 (100, 100, 1);
46 main1 (0, 15, 0);
47 return 0;
50 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
51 /* { dg-final { cleanup-tree-dump "vect" } } */