Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-complex-2.c
blob498e742a33ffcc58e09e06b856e7617b8e95b675
1 /* { dg-require-effective-target vect_double } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 _Complex double a[N] =
9 { 10.0F + 20.0iF, 11.0F + 21.0iF, 12.0F + 22.0iF, 13.0F + 23.0iF,
10 14.0F + 24.0iF, 15.0F + 25.0iF, 16.0F + 26.0iF, 17.0F + 27.0iF,
11 18.0F + 28.0iF, 19.0F + 29.0iF, 20.0F + 30.0iF, 21.0F + 31.0iF,
12 22.0F + 32.0iF, 23.0F + 33.0iF, 24.0F + 34.0iF, 25.0F + 35.0iF };
13 _Complex double b[N] =
14 { 30.0F + 40.0iF, 31.0F + 41.0iF, 32.0F + 42.0iF, 33.0F + 43.0iF,
15 34.0F + 44.0iF, 35.0F + 45.0iF, 36.0F + 46.0iF, 37.0F + 47.0iF,
16 38.0F + 48.0iF, 39.0F + 49.0iF, 40.0F + 50.0iF, 41.0F + 51.0iF,
17 42.0F + 52.0iF, 43.0F + 53.0iF, 44.0F + 54.0iF, 45.0F + 55.0iF };
19 _Complex double c[N];
20 _Complex double res[N] =
21 { 40.0F + 60.0iF, 42.0F + 62.0iF, 44.0F + 64.0iF, 46.0F + 66.0iF,
22 48.0F + 68.0iF, 50.0F + 70.0iF, 52.0F + 72.0iF, 54.0F + 74.0iF,
23 56.0F + 76.0iF, 58.0F + 78.0iF, 60.0F + 80.0iF, 62.0F + 82.0iF,
24 64.0F + 84.0iF, 66.0F + 86.0iF, 68.0F + 88.0iF, 70.0F + 90.0iF };
27 __attribute__ ((noinline)) void
28 foo (void)
30 int i;
32 for (i = 0; i < N; i++)
33 c[i] = a[i] + b[i];
37 int
38 main (void)
40 int i;
41 check_vect ();
43 foo ();
45 /* check results: */
46 for (i = 0; i < N; i++)
47 if (c[i] != res[i])
48 abort ();
50 return 0;
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
55 /* { dg-final { cleanup-tree-dump "vect" } } */