From 36dcb3a97d01cc0b9a45f0d2374e97a8ec8749e1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 10 Sep 2020 17:10:57 +0930 Subject: [PATCH] Re: lto-18 test Extend the test a little to archives, not that we expect this to fail. Nor has the lto-18 test ever failed without -flto. * testsuite/ld-plugin/lto-18b.c (select): Remove. * testsuite/ld-plugin/lto-18c.c (select): Remove. * testsuite/ld-plugin/lto.exp: Build archives for lto-18 too, and run static versions of the test. --- ld/ChangeLog | 7 +++++++ ld/testsuite/ld-plugin/lto-18b.c | 2 -- ld/testsuite/ld-plugin/lto-18c.c | 2 -- ld/testsuite/ld-plugin/lto.exp | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 27df4a0e9dd..621167de0fb 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-09-10 Alan Modra + + * testsuite/ld-plugin/lto-18b.c (select): Remove. + * testsuite/ld-plugin/lto-18c.c (select): Remove. + * testsuite/ld-plugin/lto.exp: Build archives for lto-18 too, + and run static versions of the test. + 2020-09-09 Alan Modra * testsuite/ld-plugin/lto-18a.c, diff --git a/ld/testsuite/ld-plugin/lto-18b.c b/ld/testsuite/ld-plugin/lto-18b.c index 0ae3a20c146..ca78bbf216d 100644 --- a/ld/testsuite/ld-plugin/lto-18b.c +++ b/ld/testsuite/ld-plugin/lto-18b.c @@ -1,5 +1,3 @@ -int select (void) { return 1; } - extern int f2 (int); int f1 (int x) diff --git a/ld/testsuite/ld-plugin/lto-18c.c b/ld/testsuite/ld-plugin/lto-18c.c index 90cc81bea34..5ade283917a 100644 --- a/ld/testsuite/ld-plugin/lto-18c.c +++ b/ld/testsuite/ld-plugin/lto-18c.c @@ -1,5 +1,3 @@ -int select (void) { return 2; } - extern int f1 (int); int f2 (int x) diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 0479e3e4035..abb712575f4 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -407,9 +407,15 @@ set lto_link_elf_tests [list \ [list {liblto-18b.so} \ {-shared} {-O2 -fpic} \ {lto-18b.c} {} {liblto-18b.so}] \ + [list {liblto-18b.a} \ + "$plug_opt" {-flto -O2} \ + {lto-18b.c} {} {liblto-18b.a}] \ [list {liblto-18c.so} \ {-shared} {-O2 -fpic} \ {lto-18c.c} {} {liblto-18c.so}] \ + [list {liblto-18c.a} \ + "$plug_opt" {-flto -O2} \ + {lto-18c.c} {} {liblto-18c.a}] \ [list {lto-18d.o} \ {} {-flto -O2} \ {lto-18d.c} {} {}] \ @@ -586,6 +592,14 @@ set lto_run_elf_shared_tests [list \ {-flto -fuse-linker-plugin} {} \ {lto-18a.c} {lto-18-2.exe} {lto-18.out} {-flto -O2} {c} {} \ {-Wl,--as-needed,-R,tmpdir -Ltmpdir -llto-18b -llto-18c tmpdir/lto-18d.o}] \ + [list {lto-18 (3)} \ + {-static -flto -fuse-linker-plugin} {} \ + {lto-18a.c} {lto-18-3.exe} {lto-18.out} {-flto -O2} {c} {} \ + {tmpdir/lto-18d.o -Ltmpdir -llto-18b -llto-18c}] \ + [list {lto-18 (4)} \ + {-static -flto -fuse-linker-plugin} {} \ + {lto-18a.c} {lto-18-4.exe} {lto-18.out} {-flto -O2} {c} {} \ + { -Ltmpdir -llto-18b -llto-18c tmpdir/lto-18d.o}] \ ] # LTO run-time tests for ELF -- 2.30.2