OSDN Git Service

ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / lto.exp
index 1dd9c34..3d40efc 100644 (file)
 
 # Contributed by Diego Novillo <dnovillo@google.com>
 
+# Prune messages from gcc that aren't useful.
+
+proc lto_prune_vis_warns { text } {
+
+    # 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
+
+    return $text
+}
 
 # lto_init -- called at the start of each subdir of tests
 
@@ -147,6 +160,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_vis_warns $comp_output]
+
     if ![${tool}_check_compile "$testcase $testname link" "" \
         $dest $comp_output] then {
        unresolved "$testcase $testname execute $optstr"