From: Tom de Vries Date: Thu, 14 Dec 2017 15:01:47 +0000 (+0000) Subject: Require effective target weak_undefined for visibility-22.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aadd37c8a055e072475fe257681a95dc9b0c8849;p=gcc.git Require effective target weak_undefined for visibility-22.c 2017-12-14 Tom de Vries * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8a08268b93..af6304bb57e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-14 Tom de Vries + + * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): + Add item for weak_undefined. + 2017-12-14 Richard Biener PR tree-optimization/67842 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 60b6b77abc6..04e18df8461 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9bd5cbbe1bd..bc9fa99603d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-12-14 Tom de Vries + + * 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 PR tree-optimization/83326 diff --git a/gcc/testsuite/gcc.dg/visibility-22.c b/gcc/testsuite/gcc.dg/visibility-22.c index 5e8cdad4f40..e2b78d1c7fd 100644 --- a/gcc/testsuite/gcc.dg/visibility-22.c +++ b/gcc/testsuite/gcc.dg/visibility-22.c @@ -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 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ff8c8050652..114c1f11ccc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -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 { } ###############################