Merge from trunk
[official-gcc.git] / gcc / testsuite / c-c++-common / cilk-plus / CK / pr60197.c
blob2b47d1efb7dc4d2b0594ca120f51e97f4fdf40f2
1 /* PR c/60197 */
2 /* { dg-do compile } */
3 /* { dg-options "-fcilkplus" } */
5 extern int foo (void);
6 extern int bar (int);
8 int
9 fn1 (void)
11 return (_Cilk_spawn foo ()) * 2; /* { dg-error "in a return statement is not allowed" } */
14 int
15 fn2 (void)
17 return (_Cilk_spawn foo ()) > 2; /* { dg-error "in a return statement is not allowed" } */
20 int
21 fn3 (int i, int j, int k)
23 return ((((((_Cilk_spawn foo () + i) - j) * k) / j) | i) ^ k) ; /* { dg-error "in a return statement is not allowed" } */
26 int
27 fn4 (int i, int j, int k)
29 return (((((i - _Cilk_spawn foo ()) * k) / j) | i) ^ k); /* { dg-error "in a return statement is not allowed" } */
32 int
33 fn5 (void)
35 return _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
38 int
39 fn6 (void)
41 return _Cilk_spawn foo () + _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
44 int
45 fn7 (void)
47 return 5 % _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
50 int
51 fn8 (void)
53 return !_Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
56 int
57 fn9 (void)
59 return foo () && _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
62 int
63 fn10 (void)
65 return bar (_Cilk_spawn foo ()); /* { dg-error "in a return statement is not allowed" } */