AVR: Assert minimal required bit width of section_common::flags.
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / reduction-4.c
blobd152674be45d8505c537bcdd795f82b992d25ff6
1 /* { dg-do run { target { ! { hppa*-*-hpux* } } } } */
3 /* complex reductions. */
5 #include <stdlib.h>
6 #include <complex.h>
7 #include "reduction.h"
9 #define ng 8
10 #define nw 4
11 #define vl 32
13 static void
14 test_reductions (void)
16 const int n = 10;
17 int i;
18 double _Complex array[n];
20 for (i = 0; i < n; i++)
21 array[i] = i+1;
23 /* Gang reductions. */
24 check_reduction_op (double, +, 0, creal (array[i]), num_gangs (ng), gang);
25 check_reduction_op (double, *, 1, creal (array[i]), num_gangs (ng), gang);
27 /* Worker reductions. */
28 check_reduction_op (double, +, 0, creal (array[i]), num_workers (nw),
29 worker);
30 check_reduction_op (double, *, 1, creal (array[i]), num_workers (nw),
31 worker);
33 /* Vector reductions. */
34 check_reduction_op (double, +, 0, creal (array[i]), vector_length (vl),
35 vector);
36 check_reduction_op (double, *, 1, creal (array[i]), vector_length (vl),
37 vector);
39 /* Combined reductions. */
40 check_reduction_op (double, +, 0, creal (array[i]), num_gangs (ng)
41 num_workers (nw) vector_length (vl), gang worker
42 vector);
43 check_reduction_op (double, *, 1, creal (array[i]), num_gangs (ng)
44 num_workers (nw) vector_length (vl), gang worker
45 vector);
48 int
49 main (void)
51 test_reductions ();
52 return 0;