OSDN Git Service

* lib/lto.exp (lto_prune_vis_warns): Renamed to lto_prune_warns.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / lto.exp
index 9e9084d..e5aaf3a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 # Contributed by Diego Novillo <dnovillo@google.com>
 
+# Prune messages that aren't useful.
+
+proc lto_prune_warns { text } {
+
+    verbose "lto_prune_warns: entry: $text" 2
+
+    # Many tests that use visibility will still pass on platforms that don't support it.
+    regsub -all "(^|\n)\[^\n\]*: warning: visibility attribute not supported in this configuration; ignored\[^\n\]*" $text "" text
+
+    # And any stray location lines.
+    regsub -all "(^|\n)\[^\n\]*: In function \[^\n\]*" $text "" text
+    regsub -all "(^|\n)In file included from :\[^\n\]*" $text "" text
+
+    # Sun ld warns about common symbols with differing sizes.  Unlike GNU ld
+    # --warn-common (off by default), they cannot be disabled.
+    regsub -all "(^|\n)ld: warning: symbol `\[^\n\]*' has differing sizes:" $text "" text
+    regsub -all "(^|\n)\[ \t\]*\[\(\]file \[^\n\]* value=\[^\n\]*; file \[^\n\]* value=\[^\n\]*\[)\];" $text "" text
+    regsub -all "(^|\n)\[ \t\]*\[^\n\]* definition taken" $text "" text
+
+    verbose "lto_prune_warns: exit: $text" 2
+
+    return $text
+}
 
 # lto_init -- called at the start of each subdir of tests
 
@@ -147,6 +170,10 @@ proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } {
     # Link the objects into an executable.
     set comp_output [${tool}_target_compile "$objlist" $dest executable \
                     "$options"]
+
+    # Prune unimportant visibility warnings before checking output.
+    set comp_output [lto_prune_warns $comp_output]
+
     if ![${tool}_check_compile "$testcase $testname link" "" \
         $dest $comp_output] then {
        unresolved "$testcase $testname execute $optstr"
@@ -311,7 +338,7 @@ proc lto-get-options { src } {
 # SID identifies a test suite in the names of temporary files.
 proc lto-execute { src1 sid } {
     global srcdir tmpdir
-    global option_list
+    global lto_option_list
     global tool
     global verbose
     global testcase
@@ -334,12 +361,12 @@ proc lto-execute { src1 sid } {
     set compile_xfail(0) "" 
 
     # If the main file defines dg-options, those flags are used to
-    # overwrite the default option_list taken from LTO_OPTIONS.
+    # overwrite the default lto_option_list taken from LTO_OPTIONS.
     if { [string length $extra_flags(0)] > 0 } {
-       set option_list $extra_flags(0)
+       set lto_option_list $extra_flags(0)
        set extra_flags(0) ""
     } else {
-       set option_list $LTO_OPTIONS
+       set lto_option_list $LTO_OPTIONS
     }
 
     # Check whether this test is supported for this target.
@@ -417,7 +444,7 @@ proc lto-execute { src1 sid } {
 
     # Loop through all of the option lists used for this test.
     set count 0
-    foreach option $option_list {
+    foreach option $lto_option_list {
        verbose "Testing $testcase, $option"
 
        # There's a unique name for each executable we generate.