diff mbox

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

Message ID BF230D13CA30DD48930C31D4099330003A4BACCA@FMSMSX101.amr.corp.intel.com
State New
Headers show

Commit Message

Iyer, Balaji V Jan. 15, 2014, 5:46 p.m. UTC
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 mbox

Patch

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