comparison 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
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do run } */
2 /* { dg-require-effective-target cilkplus_runtime } */
3 /* { dg-options "-fcilkplus -O2" } */
4
5 int noop(int x)
6 {
7 return x;
8 }
9
10 int post_increment(int *x)
11 {
12 return (*x)++;
13 }
14
15 int main(int argc, char *argv[])
16 {
17 int m = 5;
18 int n = m;
19 int r = _Cilk_spawn noop(post_increment(&n));
20 int n2 = n;
21 _Cilk_sync;
22
23 if (r != m || n2 != m + 1)
24 return 1;
25 else
26 return 0;
27 }
28