diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2000-06-05 20:43:18 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2000-06-05 20:43:18 +0000 |
commit | 7cda33a15efa285ef24ad6bbcc6c4dfc4d73a0cd (patch) | |
tree | e428d05d3e7975bd833ca1b374eef0b0a0faa151 /ld/testsuite/ld-elfvsb/elfvsb.exp | |
parent | 422ea4b878539bcf1c356f9a212a6b08244c81f0 (diff) | |
download | gdb-7cda33a15efa285ef24ad6bbcc6c4dfc4d73a0cd.zip gdb-7cda33a15efa285ef24ad6bbcc6c4dfc4d73a0cd.tar.gz gdb-7cda33a15efa285ef24ad6bbcc6c4dfc4d73a0cd.tar.bz2 |
2000-06-05 H.J. Lu (hjl@gnu.org)
* lib/ld-lib.exp (default_ld_link): Redirect the linker output
to link_output and make it global.
* ld-elfvsb/elfvsb.exp (visibility_test): Add "hidden_undef",
"hidden_undef_def", "hidden_weak", "protected_undef",
"protected_undef_def" and "protected_weak".
(visibility_run): Likewise.
* ld-elfvsb/main.c: Likewise.
* ld-elfvsb/sh1.c: Likewise.
* ld-elfvsb/sh2.c: Likewise.
* ld-elfvsb/elfvsb.dat: Updated.
Diffstat (limited to 'ld/testsuite/ld-elfvsb/elfvsb.exp')
-rw-r--r-- | ld/testsuite/ld-elfvsb/elfvsb.exp | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp index 746200e..3c45e51 100644 --- a/ld/testsuite/ld-elfvsb/elfvsb.exp +++ b/ld/testsuite/ld-elfvsb/elfvsb.exp @@ -93,7 +93,17 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } { set shared "-bM:SRE -bE:$tmpdir/xcoff.exp" } if {![ld_simple_link $ld $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} { - fail "$testname" + if { [ string match $visibility "hidden_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "protected_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { + fail "$testname" + }} return } @@ -107,15 +117,22 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } { } if ![ld_link $ld $tmpdir/$progname "-rpath $rpath $tmpdir/$main $tmpdir/$progname.so"] { if { [ string match $visibility "hidden" ] - && [string match "*/main.c*: undefined reference to \`visibility\'" $link_output] } { + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "hidden_undef_def" ] + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { pass "$testname" } else { fail "$testname" - } + }} return } - if [ string match $visibility "hidden" ] { + if { [ string match $visibility "hidden" ] + || [ string match $visibility "hidden_undef" ] + || [ string match $visibility "protected_undef" ] } { fail "$testname" } @@ -159,11 +176,23 @@ proc visibility_run {visibility} { set VSBCFLAG "-DHIDDEN_TEST" } else { if [ string match $visibility "hidden_normal" ] { set VSBCFLAG "-DHIDDEN_NORMAL_TEST" + } else { if [ string match $visibility "hidden_undef" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST" + } else { if [ string match $visibility "hidden_undef_def" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "hidden_weak" ] { + set VSBCFLAG "-DHIDDEN_WEAK_TEST" } else { if [ string match $visibility "protected" ] { set VSBCFLAG "-DPROTECTED_TEST" + } else { if [ string match $visibility "protected_undef" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST" + } else { if [ string match $visibility "protected_undef_def" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "protected_weak" ] { + set VSBCFLAG "-DPROTECTED_WEAK_TEST" } else { set VSBCFLAG "" - }}} + }}}}}}}}} # Compile the main program. if ![ld_compile "$CC $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] { @@ -289,7 +318,13 @@ verbose "Using $picflag to compile PIC code" visibility_run hidden visibility_run hidden_normal +visibility_run hidden_undef +visibility_run hidden_undef_def +visibility_run hidden_weak visibility_run protected +visibility_run protected_undef +visibility_run protected_undef_def +visibility_run protected_weak visibility_run normal if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { |