Hello Everyone,
        I am adding a new execution test to the array notation suite. In array 
notation's __sec_reduce_max_ind and __sec_reduce_min_ind builtin functions, if 
there is a  tie for max/min value, then the higher index should be returned. In 
this case, all the values are the same, so it should return the highest index 
of the array (i.e. size-1).

I am going to check this in as obvious. I am willing to revert this patch (or 
fix it) if anyone has any objections.

Here is the ChangeLog for it.

2013-06-17  Balaji V. Iyer  <balaji.v.i...@intel.com>

        * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: New test.

Here is the patch:

Index: gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c
===================================================================
--- gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c 
(revision 0)
+++ gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c 
(revision 0)
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-fcilkplus" } */
+
+int A[256];
+
+int main () {
+    A[:] = 2;
+    int max_index = 0, min_index = 0;
+
+    max_index = __sec_reduce_max_ind (A[:]);
+
+    if (max_index != 255)
+      return 1;
+
+    min_index = __sec_reduce_min_ind (A[:]);
+    if (min_index != 255)
+      return 2;
+
+    return 0;
+}
+

Thanks,

Balaji V. Iyer.

Reply via email to