sec_reduce_ind_same_value.c: New test.
authorBalaji V. Iyer <balaji.v.iyer@intel.com>
Mon, 17 Jun 2013 18:21:14 +0000 (18:21 +0000)
committerBalaji V. Iyer <bviyer@gcc.gnu.org>
Mon, 17 Jun 2013 18:21:14 +0000 (11:21 -0700)
2013-06-17  Balaji V. Iyer  <balaji.v.iyer@intel.com>

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

From-SVN: r200155

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c [new file with mode: 0644]

index 3197f6e6e858161a98ec1cda82079055ea95f5b1..a268ad2106c859d1dee2f10bc32e3deefe26f906 100644 (file)
@@ -1,3 +1,7 @@
+2013-06-17  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: New test.
+
 2013-06-17  Balaji V. Iyer  <balaji.v.iyer@intel.com>
        
        * c-c++-common/cilk-plus/AN/array_test1.c: Make this an execution test.
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c
new file mode 100644 (file)
index 0000000..34c6f12
--- /dev/null
@@ -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;
+}
+