+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>
* ld-elf/frame.s: Replace @ with % so that the file can be
#if !defined (HIDDEN_TEST) && defined (PROTECTED_TEST)
int
-visibility ()
+visibility (void)
{
return 1;
}
static int
-main_visibility_check ()
+main_visibility_check (void)
{
return ((int (*) (void)) visibility_funptr ()) != visibility;
}
int visibility_var = 1;
static int
-main_visibility_checkvar ()
+main_visibility_checkvar (void)
{
return visibility_varval () != visibility_var
&& visibility_varptr () != &visibility_var;
asm (".protected shared_data");
int
-shared_func ()
+shared_func (void)
{
return 1;
}
#endif
#else
static int
-main_visibility_check ()
+main_visibility_check (void)
{
#ifdef WEAK_TEST
return visibility_funptr () == NULL;
}
static int
-main_visibility_checkvar ()
+main_visibility_checkvar (void)
{
#ifdef WEAK_TEST
return visibility_varval () == 0
/* This function is called by the shared library. */
int
-main_called ()
+main_called (void)
{
return 6;
}
/* This function overrides a function in the shared library. */
int
-shlib_overriddencall2 ()
+shlib_overriddencall2 (void)
{
return 8;
}
asm (".hidden visibility_com");
int
-main_visibility_checkcom ()
+main_visibility_checkcom (void)
{
return visibility_com == 0;
}
int
-main_visibility_checkweak ()
+main_visibility_checkweak (void)
{
return 1;
}
#elif defined (HIDDEN_WEAK_TEST)
int
-main_visibility_checkcom ()
+main_visibility_checkcom (void)
{
return 1;
}
asm (".hidden visibility_func");
int
-main_visibility_checkcom ()
+main_visibility_checkcom (void)
{
- return &visibility_def != NULL;
+ return & visibility_def != NULL && visibility_def == 2;
}
int
-main_visibility_checkweak ()
+main_visibility_checkweak (void)
{
- return &visibility_func != NULL;
+ return & visibility_func != NULL && visibility_func () == 2;
}
#else
int
-main_visibility_checkcom ()
+main_visibility_checkcom (void)
{
return 1;
}
int
-main_visibility_checkweak ()
+main_visibility_checkweak (void)
{
return 1;
}
#endif
int
-main ()
+main (void)
{
int (*p) ();
int ret = 0;
# It's either C or C++ at the moment.
if { $testtype == "C++" } {
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"
}