diff gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-require-effective-target cilkplus_runtime } */
+/* { dg-options "-fcilkplus -O2" } */
+
+int noop(int x)
+{
+  return x;
+}
+
+int post_increment(int *x)
+{
+  return (*x)++;
+}
+
+int main(int argc, char *argv[])
+{
+  int m = 5;
+  int n = m;
+  int r = _Cilk_spawn noop(post_increment(&n));
+  int n2 = n;
+  _Cilk_sync;
+
+  if (r != m || n2 != m + 1)
+    return 1;
+  else
+    return 0;
+}
+