Commit bef977d4 by Thomas Schwinge Committed by Thomas Schwinge

[PR testsuite/64177] Audit Cilk Plus tests for CILK_NWORKERS=1

	PR testsuite/64177
	gcc/testsuite/
	* c-c++-common/cilk-plus/CK/spawning_arg.c (main): Call
	__cilkrts_set_param to set two workers.
	* c-c++-common/cilk-plus/CK/steal_check.c (main): Likewise.
	* g++.dg/cilk-plus/CK/catch_exc.cc (main): Likewise.

From-SVN: r234523
parent ce83104b
2016-03-29 Thomas Schwinge <thomas@codesourcery.com>
PR testsuite/64177
* c-c++-common/cilk-plus/CK/spawning_arg.c (main): Call
__cilkrts_set_param to set two workers.
* c-c++-common/cilk-plus/CK/steal_check.c (main): Likewise.
* g++.dg/cilk-plus/CK/catch_exc.cc (main): Likewise.
2016-03-28 Dominique d'Humieres <dominiq@lps.ens.fr> 2016-03-28 Dominique d'Humieres <dominiq@lps.ens.fr>
g++.dg/ext/fnname5.C: Update the test for Darwin. g++.dg/ext/fnname5.C: Update the test for Darwin.
......
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus" } */
/* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
#ifdef __cplusplus
extern "C" {
#endif
extern int __cilkrts_set_param (const char *, const char *);
#ifdef __cplusplus
}
#endif
void f0(volatile int *steal_flag) void f0(volatile int *steal_flag)
{ {
int i = 0; int i = 0;
...@@ -32,6 +43,10 @@ void f3() ...@@ -32,6 +43,10 @@ void f3()
int main() int main()
{ {
/* Ensure more than one worker. */
if (__cilkrts_set_param("nworkers", "2") != 0)
__builtin_abort();
f3(); f3();
return 0; return 0;
} }
...@@ -2,8 +2,16 @@ ...@@ -2,8 +2,16 @@
/* { dg-options "-fcilkplus" } */ /* { dg-options "-fcilkplus" } */
/* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
// #include <cilk/cilk_api.h> #ifdef __cplusplus
extern void __cilkrts_set_param (char *, char *); extern "C" {
#endif
extern int __cilkrts_set_param (const char *, const char *);
#ifdef __cplusplus
}
#endif
void foo(volatile int *); void foo(volatile int *);
...@@ -11,7 +19,10 @@ void main2(void); ...@@ -11,7 +19,10 @@ void main2(void);
int main(void) int main(void)
{ {
// __cilkrts_set_param ((char *)"nworkers", (char *)"2"); /* Ensure more than one worker. */
if (__cilkrts_set_param("nworkers", "2") != 0)
__builtin_abort();
main2(); main2();
return 0; return 0;
} }
......
...@@ -10,6 +10,16 @@ ...@@ -10,6 +10,16 @@
#endif #endif
#include <cstdlib> #include <cstdlib>
#ifdef __cplusplus
extern "C" {
#endif
extern int __cilkrts_set_param (const char *, const char *);
#ifdef __cplusplus
}
#endif
void func(int volatile* steal_me) void func(int volatile* steal_me)
{ {
...@@ -59,6 +69,10 @@ void my_test() ...@@ -59,6 +69,10 @@ void my_test()
int main() int main()
{ {
/* Ensure more than one worker. */
if (__cilkrts_set_param("nworkers", "2") != 0)
__builtin_abort();
my_test(); my_test();
#if HAVE_IO #if HAVE_IO
printf("PASSED\n"); printf("PASSED\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment