OSDN Git Service

* lib/target-supports.exp (check_weak_override_available): New.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2009 23:53:03 +0000 (23:53 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2009 23:53:03 +0000 (23:53 +0000)
* lib/target-supports-dg.exp (dg-require-weak-override): New.
* gcc.dg/tree-ssa/pr27781.c, g++.dg/eh/weak1.C: Use
dg-require-weak-override.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143172 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/weak1.C
gcc/testsuite/gcc.dg/tree-ssa/pr27781.c
gcc/testsuite/lib/target-supports-dg.exp
gcc/testsuite/lib/target-supports.exp

index ccd555e..196f191 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-07  Joseph Myers  <joseph@codesourcery.com>
+
+       * lib/target-supports.exp (check_weak_override_available): New.
+       * lib/target-supports-dg.exp (dg-require-weak-override): New.
+       * gcc.dg/tree-ssa/pr27781.c, g++.dg/eh/weak1.C: Use
+       dg-require-weak-override.
+
 2009-01-07  Nathan Froyd  <froydnj@codesourcery.com>
            Alan Modra  <amodra@bigpond.net.au>
 
index 4dd08d1..f78d195 100644 (file)
@@ -1,6 +1,6 @@
 // PR target/29487
 // { dg-do run { xfail { hppa*-*-hpux* && { ! hppa*64*-*-* } } } }
-// { dg-require-weak "" }
+// { dg-require-weak-override "" }
 // { dg-additional-sources "weak1-a.cc" }
 // { dg-options "-O2" }
 
index 0e1a02a..233c93d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-require-weak "" } */
+/* { dg-require-weak-override "" } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
 
 void __attribute__((weak)) func(void)
index 321daac..fe6453b 100644 (file)
@@ -45,6 +45,21 @@ proc dg-require-weak { args } {
     }
 }
 
+# If this target does not support overriding weak symbols, skip this
+# test.
+
+proc dg-require-weak-override { args } {
+    set weak_override_available [ check_weak_override_available ]
+    if { $weak_override_available == -1 } {
+       upvar name name
+       unresolved "$name"
+    }
+    if { $weak_override_available != 1 } {
+       upvar dg-do-what dg-do-what
+       set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+    }
+}
+
 # If this target does not support the "visibility" attribute, skip this
 # test.
 
index 79e77f2..0eb40c6 100644 (file)
@@ -251,6 +251,20 @@ proc check_weak_available { } {
 }
 
 ###############################
+# proc check_weak_override_available { }
+###############################
+
+# Like check_weak_available, but return 0 if weak symbol definitions
+# cannot be overridden.
+
+proc check_weak_override_available { } {
+    if { [istarget "*-*-mingw*"] } {
+       return 0
+    }
+    return [check_weak_available]
+}
+
+###############################
 # proc check_visibility_available { what_kind }
 ###############################