From d79b7acb00900e23fdb58d535039ad2e9d026843 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 16 Aug 2020 05:45:02 -0700 Subject: [PATCH] ld: Add a PR binutils/26389 test PR binutils/26389 * testsuite/ld-plugin/lto.exp: Run PR binutils/26389 test. * testsuite/ld-plugin/pr26389.c: New file. * testsuite/ld-plugin/pr26389.d: Likewise. (cherry picked from commit 246b9ea1983d59c8b0070746a904a6b3f8d62187) --- ld/ChangeLog | 7 +++++++ ld/testsuite/ld-plugin/lto.exp | 4 ++++ ld/testsuite/ld-plugin/pr26389.c | 1 + ld/testsuite/ld-plugin/pr26389.d | 3 +++ 4 files changed, 15 insertions(+) create mode 100644 ld/testsuite/ld-plugin/pr26389.c create mode 100644 ld/testsuite/ld-plugin/pr26389.d diff --git a/ld/ChangeLog b/ld/ChangeLog index e64e28e256b..af98a3dbb1f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-08-16 H.J. Lu + + PR binutils/26389 + * testsuite/ld-plugin/lto.exp: Run PR binutils/26389 test. + * testsuite/ld-plugin/pr26389.c: New file. + * testsuite/ld-plugin/pr26389.d: Likewise. + 2020-08-14 Tamar Christina Backport from master. diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index a44b6cf4b0d..8e5a610d676 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -240,6 +240,10 @@ set lto_link_tests [list \ {dummy.c} \ {{error_output "pr26267.err"}} \ "pr26267b"] \ + [list "Build pr26389.o" \ + "$plug_opt" "-flto $lto_no_fat -fcommon" \ + {pr26389.c} \ + [list [list "nm" "$plug_opt" "pr26389.d"]]] \ ] if { [at_least_gcc_version 10 0] } { diff --git a/ld/testsuite/ld-plugin/pr26389.c b/ld/testsuite/ld-plugin/pr26389.c new file mode 100644 index 00000000000..84806ff5332 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr26389.c @@ -0,0 +1 @@ +char nm_test_var; diff --git a/ld/testsuite/ld-plugin/pr26389.d b/ld/testsuite/ld-plugin/pr26389.d new file mode 100644 index 00000000000..e4ad69a7c93 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr26389.d @@ -0,0 +1,3 @@ +#... +0+ C _?nm_test_var +#pass -- 2.47.3