Commit aadd37c8 by Tom de Vries Committed by Tom de Vries

Require effective target weak_undefined for visibility-22.c

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
parent e64905d8
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> 2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/67842 PR tree-optimization/67842
...@@ -2238,6 +2238,9 @@ Target supports @code{wchar_t} that is compatible with @code{char32_t}. ...@@ -2238,6 +2238,9 @@ Target supports @code{wchar_t} that is compatible with @code{char32_t}.
@item comdat_group @item comdat_group
Target uses comdat groups. Target uses comdat groups.
@item weak_undefined
Target supports weak undefined symbols.
@item word_mode_no_slow_unalign @item word_mode_no_slow_unalign
Target does not have slow unaligned access when doing word size accesses. Target does not have slow unaligned access when doing word size accesses.
@end table @end table
......
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> 2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/83326 PR tree-optimization/83326
......
/* PR target/32219 */ /* PR target/32219 */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-require-visibility "" } */ /* { dg-require-visibility "" } */
/* { dg-require-effective-target weak_undefined } */
/* { dg-options "-O2 -fPIC" { target fpic } } */ /* { 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"))); extern void foo () __attribute__((weak,visibility("hidden")));
int int
......
...@@ -328,6 +328,15 @@ proc check_weak_available { } { ...@@ -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 { } # proc check_weak_override_available { }
############################### ###############################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment