diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc')
-rw-r--r-- | gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc new file mode 100644 index 00000000000..0b264fecace --- /dev/null +++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/execute/sec_red_zero_test.cc @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-fcilkplus" } */ + +#if HAVE_IO +#include <iostream> +#endif +int A[16]; + +int main () { + A[:] = 5; +#if HAVE_IO + std::cout << __sec_reduce_any_zero(A[:]) << "\n"; +#else + if (__sec_reduce_any_zero (A[:])) + return 1; +#endif + A[:] = 0; +#if HAVE_IO + std::cout << __sec_reduce_any_nonzero(A[:]) << "\n"; +#else + if (__sec_reduce_any_nonzero (A[:])) + return 1; +#endif + return 0; +} + |