Add a testcase for PR ld/14918
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Feb 2015 16:24:50 +0000 (08:24 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Feb 2015 16:24:50 +0000 (08:24 -0800)
PR ld/14918
* ld-plugin/lto.exp (lto_link_elf_tests): Add PR ld/14918 test.

* ld-plugin/pr14918.c: New file.
* ld-plugin/pr14918.d: Likewise.

ld/testsuite/ChangeLog
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr14918.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr14918.d [new file with mode: 0644]

index 7bc1ea6c52ff8a5aecfc75a93ff460662398124d..8351d6fbdb29bb148291374121e4a572307a7a27 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/14918
+       * ld-plugin/lto.exp (lto_link_elf_tests): Add PR ld/14918 test.
+
+       * ld-plugin/pr14918.c: New file.
+       * ld-plugin/pr14918.d: Likewise.
+
 2015-01-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        * lib/ld-lib.exp (ar_simple_create): Move -rc before $aropts.
index d8e7a1e7392ef40a4df0a506ca4f0bcc4e5d8ac1..f0643cc5453c2983adbc2765350b58c272e00b17 100644 (file)
@@ -247,6 +247,9 @@ set lto_link_elf_tests [list \
   [list "PR ld/16746 (2)" \
    "-O2 -flto -fuse-linker-plugin tmpdir/pr16746c.o tmpdir/pr16746a.o" "-O2 -flto" \
    {dummy.c} {} "pr16746b.exe"] \
+  [list "PR ld/14918" \
+   "-flto" "-flto" \
+   {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
 ]
 
 # Check final symbols in executables.
diff --git a/ld/testsuite/ld-plugin/pr14918.c b/ld/testsuite/ld-plugin/pr14918.c
new file mode 100644 (file)
index 0000000..a9bce4a
--- /dev/null
@@ -0,0 +1,5 @@
+int
+main ()
+{
+  return 0;
+}
diff --git a/ld/testsuite/ld-plugin/pr14918.d b/ld/testsuite/ld-plugin/pr14918.d
new file mode 100644 (file)
index 0000000..0b14948
--- /dev/null
@@ -0,0 +1,4 @@
+#failif
+#...
+ 0x0+1 \(NEEDED\) +Shared library: \[libgcc_s.so.[0-9]+\]
+#...