From 1dffc06f941e672e6bc68f1953834caeb5c494d9 Mon Sep 17 00:00:00 2001 From: Dave Korn Date: Sat, 19 Feb 2011 23:02:23 +0000 Subject: [PATCH] Portability tweaks for LTO tests. ld/testsuite/ChangeLog: 2011-02-20 Dave Korn <... * ld-plugin/lto-10r.d: Allow optional underscore prefixes when checking for known symbol name. * ld-plugin/lto-3r.d: Likewise. * ld-plugin/lto-5r.d: Likewise. * ld-plugin/lto-6.c: Handle non-standard etext name on Windows. * ld-plugin/lto.exp: Add $gcc_ld_flag carrying -B option to ld under test when invoking $CC directly rather than via lib support routines. --- ld/testsuite/ld-plugin/lto-10r.d | 2 +- ld/testsuite/ld-plugin/lto-3r.d | 2 +- ld/testsuite/ld-plugin/lto-5r.d | 2 +- ld/testsuite/ld-plugin/lto-6.c | 4 ++++ ld/testsuite/ld-plugin/lto.exp | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ld/testsuite/ld-plugin/lto-10r.d b/ld/testsuite/ld-plugin/lto-10r.d index 689e6ec..c496377 100644 --- a/ld/testsuite/ld-plugin/lto-10r.d +++ b/ld/testsuite/ld-plugin/lto-10r.d @@ -3,5 +3,5 @@ #nm: -p #... -[0-9a-f]+ C __gnu_lto_v.* +[0-9a-f]+ C _?__gnu_lto_v.* #pass diff --git a/ld/testsuite/ld-plugin/lto-3r.d b/ld/testsuite/ld-plugin/lto-3r.d index 1d1befe..3726718 100644 --- a/ld/testsuite/ld-plugin/lto-3r.d +++ b/ld/testsuite/ld-plugin/lto-3r.d @@ -3,5 +3,5 @@ #nm: -p #... -[0-9a-f]+ C __gnu_lto_v.* +[0-9a-f]+ C _?__gnu_lto_v.* #pass diff --git a/ld/testsuite/ld-plugin/lto-5r.d b/ld/testsuite/ld-plugin/lto-5r.d index 43e9a5c..ad1da70 100644 --- a/ld/testsuite/ld-plugin/lto-5r.d +++ b/ld/testsuite/ld-plugin/lto-5r.d @@ -3,5 +3,5 @@ #nm: -p #... -[0-9a-f]+ C __gnu_lto_v.* +[0-9a-f]+ C _?__gnu_lto_v.* #pass diff --git a/ld/testsuite/ld-plugin/lto-6.c b/ld/testsuite/ld-plugin/lto-6.c index 749e4e0..c34b805 100644 --- a/ld/testsuite/ld-plugin/lto-6.c +++ b/ld/testsuite/ld-plugin/lto-6.c @@ -1,6 +1,10 @@ #include +#if defined(__CYGWIN32__) || defined (_WIN32) +extern char _etext[] asm ("etext"); +#else extern char _etext[]; +#endif int main(void) { diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 0c49cec..07aa5d0 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -201,8 +201,8 @@ if {![string match "" $catch_output]} { # Check exported LTO linker errors. set testname "PR ld/12365" -set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"] -if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } { +set exec_output [run_host_cmd "$CC" "$gcc_ld_flag -O2 -flto -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"] +if { [ regexp "undefined reference to `_?my_bcopy'" $exec_output ] } { pass $testname } { fail $testname