]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/c-c++-common/cilk-plus/CK/varargs_test.c
2 /* { dg-require-effective-target cilkplus_runtime } */
3 /* { dg-options "-fcilkplus" } */
9 double compute_total (int no_elements
, ...);
13 double array
[5] = {5.0, 4.0, 9.0, 3.0, 4.0};
14 double array2
[5] = {5.0, 6.0, 8.0, 6.0};
15 double yy
=0, xx
=0, xx_serial
, yy_serial
;
17 yy
= _Cilk_spawn
compute_total(5,array
[0],array
[1],array
[2],
19 xx
= compute_total(4,array2
[0],array2
[1],array2
[2], array2
[3]);
23 yy_serial
= compute_total(5,array
[0],array
[1],array
[2], array
[3], array
[4]);
24 xx_serial
= compute_total(4,array2
[0],array2
[1],array2
[2], array2
[3]);
26 if ((xx
+ yy
) != (xx_serial
+ yy_serial
))
33 double compute_total (int no_elements
, ...)
37 va_start(args
, no_elements
);
39 for (ii
= 0; ii
< no_elements
; ii
++)
41 total
+= va_arg(args
,double);