This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] error in target-supports function for Cilk keywords test


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" ]
 }




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]