Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do run } */ | |
2 /* { dg-options "-fcilkplus" } */ | |
3 | |
4 int add_all (int *my_array, int size) | |
5 { | |
6 return __sec_reduce_add (my_array[0:size]); | |
7 } | |
8 | |
9 int mult_all (int *my_array, int size) | |
10 { | |
11 return __sec_reduce_mul (my_array[0:size]); | |
12 } | |
13 | |
14 int main (void) | |
15 { | |
16 int argc = 1; | |
17 int array[10000]; | |
18 | |
19 __asm volatile ("" : "+r" (argc)); | |
20 array[:] = argc; /* All elements should be one. */ | |
21 | |
22 if (add_all (array, 10000) != 10000) | |
23 return 1; | |
24 | |
25 if (mult_all (array, 10000) != 1) | |
26 return 2; | |
27 | |
28 return 0; | |
29 } |