diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-02-26 03:56:28 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-02-26 03:58:47 -0800 |
commit | 3312f67c0957196e41db149343d04ee7b30cdc65 (patch) | |
tree | 4f37e29c2c7215d5d914bd140679d977276a2c69 | |
parent | 02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff (diff) | |
download | gdb-3312f67c0957196e41db149343d04ee7b30cdc65.zip gdb-3312f67c0957196e41db149343d04ee7b30cdc65.tar.gz gdb-3312f67c0957196e41db149343d04ee7b30cdc65.tar.bz2 |
ld: Add PR ld/25593 tests
PR ld/25593
* testsuite/ld-plugin/lto.exp: Run PR ld/25593 tests.
* testsuite/ld-plugin/pr25593.d: New file.
* testsuite/ld-plugin/pr25593a-1.c: Likewise.
* testsuite/ld-plugin/pr25593a-2.c: Likewise.
* testsuite/ld-plugin/pr25593b.c: Likewise.
* testsuite/ld-plugin/pr25593c.c: Likewise.
* testsuite/ld-plugin/pr25593d.c: Likewise.
* testsuite/ld-plugin/pr25593e.c: Likewise.
-rw-r--r-- | ld/ChangeLog | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 26 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593a-1.c | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593a-2.c | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593b.c | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593c.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593d.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr25593e.c | 4 |
9 files changed, 75 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 9333dff..56e84c1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,15 @@ +2020-02-26 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/25593 + * testsuite/ld-plugin/lto.exp: Run PR ld/25593 tests. + * testsuite/ld-plugin/pr25593.d: New file. + * testsuite/ld-plugin/pr25593a-1.c: Likewise. + * testsuite/ld-plugin/pr25593a-2.c: Likewise. + * testsuite/ld-plugin/pr25593b.c: Likewise. + * testsuite/ld-plugin/pr25593c.c: Likewise. + * testsuite/ld-plugin/pr25593d.c: Likewise. + * testsuite/ld-plugin/pr25593e.c: Likewise. + 2020-02-26 Alan Modra <amodra@gmail.com> * emultempl/cskyelf.em: Indent labels correctly. diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 1b44b0d..0243f09 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -342,6 +342,32 @@ set lto_link_elf_tests [list \ [list "PR ld/24486" \ "-O2 -flto tmpdir/pr24486a.o tmpdir/pr24486c.so -Wl,--as-needed tmpdir/pr24486b.so" "" \ {dummy.c} {} "pr24486.exe"] \ + [list "Build pr25593a-1.o" \ + "$plug_opt" "-flto -O2" \ + {pr25593a-1.c} {} "" "c"] \ + [list "Build pr25593a-2.o" \ + "" "-O2" \ + {pr25593a-2.c} {} "" "c"] \ + [list "Build pr25593b.o" \ + "" "-O2" \ + {pr25593b.c} {} "" "c"] \ + [list "Build pr25593c.so" \ + "-shared" "-O2 -fpic" \ + {pr25593c.c} {} "pr25593c.so" "c"] \ + [list "Build pr25593d.so" \ + "-shared" "-O2 -fpic" \ + {pr25593d.c} {} "pr25593d.so" "c"] \ + [list "Build pr25593e.so" \ + "-shared" "-O2 -fpic" \ + {pr25593e.c} {} "pr25593e.so" "c"] \ + [list "PR ld/r25593 (LTO)" \ + "-O2 -flto -Wl,--as-needed tmpdir/pr25593a-1.o tmpdir/pr25593b.o \ + tmpdir/pr25593c.so tmpdir/pr25593d.so tmpdir/pr25593e.so" "" \ + {dummy.c} {{readelf {-d --wide} pr25593.d}} "pr25593a.exe"] \ + [list "PR ld/r25593" \ + "-O2 -flto -Wl,--as-needed tmpdir/pr25593a-2.o tmpdir/pr25593b.o \ + tmpdir/pr25593c.so tmpdir/pr25593d.so tmpdir/pr25593e.so" "" \ + {dummy.c} {{readelf {-d --wide} pr25593.d}} "pr25593b.exe"] \ ] # PR 14918 checks that libgcc is not spuriously included in a shared link of diff --git a/ld/testsuite/ld-plugin/pr25593.d b/ld/testsuite/ld-plugin/pr25593.d new file mode 100644 index 0000000..7787767 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593.d @@ -0,0 +1,5 @@ +#... + 0x0+1 \(NEEDED\) +Shared library: \[tmpdir/pr25593c\.so\] + 0x0+1 \(NEEDED\) +Shared library: \[tmpdir/pr25593d\.so\] + 0x0+1 \(NEEDED\) +Shared library: \[tmpdir/pr25593e\.so\] +#pass diff --git a/ld/testsuite/ld-plugin/pr25593a-1.c b/ld/testsuite/ld-plugin/pr25593a-1.c new file mode 100644 index 0000000..13d5395 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593a-1.c @@ -0,0 +1,12 @@ +extern void foo (void); +extern void bar (void); +extern void xxx (void); + +int +main (void) +{ + xxx (); + foo (); + bar (); + return 0; +} diff --git a/ld/testsuite/ld-plugin/pr25593a-2.c b/ld/testsuite/ld-plugin/pr25593a-2.c new file mode 100644 index 0000000..bdc30dd --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593a-2.c @@ -0,0 +1 @@ +#include "pr25593a-1.c" diff --git a/ld/testsuite/ld-plugin/pr25593b.c b/ld/testsuite/ld-plugin/pr25593b.c new file mode 100644 index 0000000..75b2419 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593b.c @@ -0,0 +1,7 @@ +extern void xyz (); + +void +xxx (void) +{ + xyz (); +} diff --git a/ld/testsuite/ld-plugin/pr25593c.c b/ld/testsuite/ld-plugin/pr25593c.c new file mode 100644 index 0000000..cd0130c --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593c.c @@ -0,0 +1,4 @@ +void +foo (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr25593d.c b/ld/testsuite/ld-plugin/pr25593d.c new file mode 100644 index 0000000..7de81b3 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593d.c @@ -0,0 +1,4 @@ +void +bar (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr25593e.c b/ld/testsuite/ld-plugin/pr25593e.c new file mode 100644 index 0000000..831b105 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr25593e.c @@ -0,0 +1,4 @@ +void +xyz (void) +{ +} |