]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Require effective target weak_undefined for visibility-22.c
authorTom de Vries <tom@codesourcery.com>
Thu, 14 Dec 2017 15:01:47 +0000 (15:01 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Thu, 14 Dec 2017 15:01:47 +0000 (15:01 +0000)
2017-12-14  Tom de Vries  <tom@codesourcery.com>

* lib/target-supports.exp (check_effective_target_weak_undefined): New
proc.
* gcc.dg/visibility-22.c: Require effective target weak_undefined.

* doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
Add item for weak_undefined.

From-SVN: r255637

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/visibility-22.c
gcc/testsuite/lib/target-supports.exp

index b8a08268b9389d039566d222c4aa55de4770656e..af6304bb57e5d1a4d141b9c77bf083fe6b1b0172 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-14  Tom de Vries  <tom@codesourcery.com>
+
+       * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
+       Add item for weak_undefined.
+
 2017-12-14  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/67842
index 60b6b77abc6188dabd53bc5d1b31fe0861fd8638..04e18df846156998bdbb71c2fb25bb0977662c82 100644 (file)
@@ -2238,6 +2238,9 @@ Target supports @code{wchar_t} that is compatible with @code{char32_t}.
 @item comdat_group
 Target uses comdat groups.
 
+@item weak_undefined
+Target supports weak undefined symbols.
+
 @item word_mode_no_slow_unalign
 Target does not have slow unaligned access when doing word size accesses.
 @end table
index 9bd5cbbe1bdbb1d8a2d2811944826a10a07e8160..bc9fa99603ddecc1205eb8cf778550edf4574b8e 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-14  Tom de Vries  <tom@codesourcery.com>
+
+       * lib/target-supports.exp (check_effective_target_weak_undefined): New
+       proc.
+       * gcc.dg/visibility-22.c: Require effective target weak_undefined.
+
 2017-12-14  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/83326
index 5e8cdad4f405094cf5e884245e1e4037b94f8c21..e2b78d1c7fdedb8e91811b9b370089f4711e4e96 100644 (file)
@@ -1,11 +1,8 @@
 /* PR target/32219 */
 /* { dg-do run } */
 /* { dg-require-visibility "" } */
+/* { dg-require-effective-target weak_undefined } */
 /* { dg-options "-O2 -fPIC" { target fpic } } */
-/* This test requires support for undefined weak symbols.  This support
-   is not available on hppa*-*-hpux*.  The test is skipped rather than
-   xfailed to suppress the warning that would otherwise arise.  */
-/* { dg-skip-if "" { "hppa*-*-hpux*" "*-*-aix*" "*-*-darwin*" } }  */
 
 extern void foo () __attribute__((weak,visibility("hidden")));
 int
index ff8c8050652baf21efa6066142e60dec06b5f924..114c1f11ccc00fb50a595e613122429e09c5925f 100644 (file)
@@ -328,6 +328,15 @@ proc check_weak_available { } {
     }
 }
 
+# return 1 if weak undefined symbols are supported.
+
+proc check_effective_target_weak_undefined { } {
+    return [check_runtime weak_undefined {
+       extern void foo () __attribute__((weak));
+       int main (void) { if (foo) return 1; return 0; }
+    } ""]
+}
+
 ###############################
 # proc check_weak_override_available { }
 ###############################