1/* { dg-do compile } */
2/* { dg-options "-fcilkplus" } */
3
4/* <feature>
5   A program is considered ill formed if the _Cilk_spawn form of this
6    expression appears other than in one of the following contexts:
7    as the entire body of an expression statement,
8    as the entire right hand side of an assignment expression that is the entire
9    body of an expression statement, or as the entire initializer-clause in a
10    simple declaration.
11   </feature>
12*/
13
14int spawn_func (int arg)
15{
16  return arg + 1;
17}
18
19int check()
20{
21  int z;
22  z = 23, _Cilk_spawn spawn_func (3), 3424; /* { dg-error "spawned function call cannot be part of a comma expression" } */
23  23, spawn_func (5), _Cilk_spawn spawn_func (3); /* { dg-error "spawned function call cannot be part of a comma expression" } */
24  _Cilk_spawn spawn_func (0), _Cilk_spawn spawn_func (3), 3, spawn_func (0); /* { dg-error "spawned function call cannot be part of a comma expression" } */
25  return 23;
26}
27