This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, committed] error in target-supports function for Cilk keywords test
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 15 Jan 2014 17:46:23 +0000
- Subject: [PATCH, committed] error in target-supports function for Cilk keywords test
- Authentication-results: sourceware.org; auth=none
Hello Everyone,
I noticed that there was an error in the testcode in "check_libcilkrts_available" target-supports function for C++. It was working fine in C but needed an extern "C" along with a prototype for C++. This patch below should fix that. This patch is committed as obvious (..more like "doh!"). If anyone has any issues, please let me know and I will fix them.
Thanks,
Balaji V. Iyer.
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 159f88f..ebb28ae 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1038,9 +1038,13 @@ proc check_iconv_available { test_what } {
# Return true if Cilk Library is supported on the target.
proc check_libcilkrts_available { } {
return [ check_no_compiler_messages_nocache libcilkrts_available executable {
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ int __cilkrts_set_param (const char *, const char *);
int main (void) {
- __cilkrts_set_param ("nworkers", "0");
- return 0;
+ int x = __cilkrts_set_param ("nworkers", "0");
+ return x;
}
} "-fcilkplus -lcilkrts" ]
}