* ld-elfvsb/main.c: Ensure visibility_def and visibility_func are

actually referenced (gcc 3.4 eliminates comparisons of addresses
  of global symbols with NULL).
* ld-selective/selective.exp: Suppress -fvtable-gc tests for gcc
  3.4.0 and above, as this option and its functionality is no longer
  supported, making these tests fail).
This commit is contained in:
Nick Clifton
2004-06-18 15:41:47 +00:00
parent cad48f8ed9
commit 23a75657ad
3 changed files with 35 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2004-06-18 Jan Beulich <jbeulich@novell.com>
* ld-elfvsb/main.c: Ensure visibility_def and visibility_func are
actually referenced (gcc 3.4 eliminates comparisons of addresses
of global symbols with NULL).
* ld-selective/selective.exp: Suppress -fvtable-gc tests for gcc
3.4.0 and above, as this option and its functionality is no longer
supported, making these tests fail).
2004-05-18 Nick Clifton <nickc@redhat.com> 2004-05-18 Nick Clifton <nickc@redhat.com>
* ld-elf/frame.s: Replace @ with % so that the file can be * ld-elf/frame.s: Replace @ with % so that the file can be

View File

@ -74,13 +74,13 @@ extern int visibility_var;
#if !defined (HIDDEN_TEST) && defined (PROTECTED_TEST) #if !defined (HIDDEN_TEST) && defined (PROTECTED_TEST)
int int
visibility () visibility (void)
{ {
return 1; return 1;
} }
static int static int
main_visibility_check () main_visibility_check (void)
{ {
return ((int (*) (void)) visibility_funptr ()) != visibility; return ((int (*) (void)) visibility_funptr ()) != visibility;
} }
@ -88,7 +88,7 @@ main_visibility_check ()
int visibility_var = 1; int visibility_var = 1;
static int static int
main_visibility_checkvar () main_visibility_checkvar (void)
{ {
return visibility_varval () != visibility_var return visibility_varval () != visibility_var
&& visibility_varptr () != &visibility_var; && visibility_varptr () != &visibility_var;
@ -99,7 +99,7 @@ int shared_data = 1;
asm (".protected shared_data"); asm (".protected shared_data");
int int
shared_func () shared_func (void)
{ {
return 1; return 1;
} }
@ -112,7 +112,7 @@ extern func shared_func_p ();
#endif #endif
#else #else
static int static int
main_visibility_check () main_visibility_check (void)
{ {
#ifdef WEAK_TEST #ifdef WEAK_TEST
return visibility_funptr () == NULL; return visibility_funptr () == NULL;
@ -122,7 +122,7 @@ main_visibility_check ()
} }
static int static int
main_visibility_checkvar () main_visibility_checkvar (void)
{ {
#ifdef WEAK_TEST #ifdef WEAK_TEST
return visibility_varval () == 0 return visibility_varval () == 0
@ -137,7 +137,7 @@ main_visibility_checkvar ()
/* This function is called by the shared library. */ /* This function is called by the shared library. */
int int
main_called () main_called (void)
{ {
return 6; return 6;
} }
@ -145,7 +145,7 @@ main_called ()
/* This function overrides a function in the shared library. */ /* This function overrides a function in the shared library. */
int int
shlib_overriddencall2 () shlib_overriddencall2 (void)
{ {
return 8; return 8;
} }
@ -155,19 +155,19 @@ int visibility_com;
asm (".hidden visibility_com"); asm (".hidden visibility_com");
int int
main_visibility_checkcom () main_visibility_checkcom (void)
{ {
return visibility_com == 0; return visibility_com == 0;
} }
int int
main_visibility_checkweak () main_visibility_checkweak (void)
{ {
return 1; return 1;
} }
#elif defined (HIDDEN_WEAK_TEST) #elif defined (HIDDEN_WEAK_TEST)
int int
main_visibility_checkcom () main_visibility_checkcom (void)
{ {
return 1; return 1;
} }
@ -203,32 +203,32 @@ extern int visibility_func ();
asm (".hidden visibility_func"); asm (".hidden visibility_func");
int int
main_visibility_checkcom () main_visibility_checkcom (void)
{ {
return &visibility_def != NULL; return & visibility_def != NULL && visibility_def == 2;
} }
int int
main_visibility_checkweak () main_visibility_checkweak (void)
{ {
return &visibility_func != NULL; return & visibility_func != NULL && visibility_func () == 2;
} }
#else #else
int int
main_visibility_checkcom () main_visibility_checkcom (void)
{ {
return 1; return 1;
} }
int int
main_visibility_checkweak () main_visibility_checkweak (void)
{ {
return 1; return 1;
} }
#endif #endif
int int
main () main (void)
{ {
int (*p) (); int (*p) ();
int ret = 0; int ret = 0;

View File

@ -89,6 +89,14 @@ foreach testitem $seltests {
# It's either C or C++ at the moment. # It's either C or C++ at the moment.
if { $testtype == "C++" } { if { $testtype == "C++" } {
set testflags "$cflags $cxxflags" set testflags "$cflags $cxxflags"
if [string match "*gcc*" [lindex $CC 0]] {
# Starting with 3.4.0, -fvtable-gc is no longer supported and thus
# the functionality we try to test for cannot be expected to work.
catch "exec -- $CC -dumpversion" version
if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
setup_xfail {*-*-*}
}
}
} { } {
set testflags "$cflags" set testflags "$cflags"
} }