diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c new file mode 100644 index 00000000000..33fd8b525d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/errors/sec_inside_sec2.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ +int A[256]; + +int add( int x, int y) +{ + return x+y; +} + +void +check () { + int a; + a = __sec_reduce_min_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_max_ind (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_any_zero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_any_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_all_nonzero (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_max (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_min (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_mul (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce_add (__sec_reduce_min_ind (A[:])); /* { dg-error "cannot have array notation parameter with zero" } */ + a = __sec_reduce (0, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */ + __sec_reduce_mutating (&a, __sec_reduce_min_ind (A[:]), add); /* { dg-error "cannot have array notation parameter with zero" } */ +} + + + |