aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2016-03-29 14:39:33 +0000
committerThomas Schwinge <thomas@codesourcery.com>2016-03-29 14:39:33 +0000
commitecd6bcb0ff924363d14c8b96c1f23aabd91e93fa (patch)
tree26ecbf3652b5ce5d25f0268a410a01b19312e610
parent4308b7583a51dacc24054fa8f878c3a2a6aab440 (diff)
[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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@234523 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c17
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc14
4 files changed, 51 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 11d68635915..f9b4b001c79 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+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>
g++.dg/ext/fnname5.C: Update the test for Darwin.
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
index 95e6cab02c1..138b82c187c 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
@@ -2,6 +2,17 @@
/* { dg-options "-fcilkplus" } */
/* { 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)
{
int i = 0;
@@ -32,6 +43,10 @@ void f3()
int main()
{
+ /* Ensure more than one worker. */
+ if (__cilkrts_set_param("nworkers", "2") != 0)
+ __builtin_abort();
+
f3();
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
index 6e2876531c3..6b41c7faf04 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
@@ -2,8 +2,16 @@
/* { dg-options "-fcilkplus" } */
/* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
-// #include <cilk/cilk_api.h>
-extern void __cilkrts_set_param (char *, char *);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int __cilkrts_set_param (const char *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
void foo(volatile int *);
@@ -11,7 +19,10 @@ void main2(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();
return 0;
}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
index 0633d19030c..09ddf8b28e3 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
@@ -10,6 +10,16 @@
#endif
#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)
{
@@ -59,6 +69,10 @@ void my_test()
int main()
{
+ /* Ensure more than one worker. */
+ if (__cilkrts_set_param("nworkers", "2") != 0)
+ __builtin_abort();
+
my_test();
#if HAVE_IO
printf("PASSED\n");