1 /* { dg-options "-fcilkplus" } */
2 /* { dg-do run { target i?86-*-* x86_64-*-* arm*-*-* } } */
3 /* { dg-options "-fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* arm*-*-* } } } */
4 /* { dg-skip-if "" { *-*-* } { "-O1" } { "" } } */
10 #include <cilk/cilk_api.h>
15 void func(int volatile* steal_me
)
22 printf("Foo executing on %d\n", __cilkrts_get_worker_number());
29 volatile int steal_me
= 0;
33 _Cilk_spawn
func(&steal_me
);
35 printf("Continuation executing on %d\n",
36 __cilkrts_get_worker_number());
46 printf("We caught x = %d\n", x
);
54 printf("We should not be here!\n");