Add tests for PR ld/16846

PR ld/16846
	* ld-plugin/lto.exp (lto_link_tests): Add tests for PR ld/16846.
	* ld-plugin/pr16846a.c: New file.
	* ld-plugin/pr16846b.c: Likewise.
	* ld-plugin/pr16846c.c: Likewise.
This commit is contained in:
H.J. Lu 2014-04-22 10:22:39 -07:00
parent d5f59c10fc
commit 43c001c7d6
5 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2014-04-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/16846
* ld-plugin/lto.exp (lto_link_tests): Add tests for PR ld/16846.
* ld-plugin/pr16846a.c: New file.
* ld-plugin/pr16846b.c: Likewise.
* ld-plugin/pr16846c.c: Likewise.
2014-04-22 Christian Svensson <blue@cmd.nu>
* ld-discard/extern.d: Remove openrisc and or32 support. Add

View File

@ -139,6 +139,18 @@ set lto_link_tests {
{"PR ld/15323"
"" "-O2"
{pr15323a.c} {} "libdummy.a" "c"}
{"Build libdummy.a(1) PR ld/pr16846"
"" "-flto"
{pr16846a.c pr16846b.c} {} "libdummy.a"}
{"Build libdummy.a(2) PR ld/pr16846"
"" ""
{pr16846c.c} {} "libdummy.a"}
{"PR ld/pr16846(1)"
"-flto -fuse-linker-plugin tmpdir/pr16846a.o tmpdir/pr16846b.o tmpdir/pr16846c.o" ""
{dummy.c} {} "pr16846a.exe"}
{"PR ld/pr16846(2)"
"-flto -fuse-linker-plugin tmpdir/pr16846a.o tmpdir/pr16846c.o tmpdir/pr16846b.o" ""
{dummy.c} {} "pr16846b.exe"}
}
if { [at_least_gcc_version 4 7] } {

View File

@ -0,0 +1,7 @@
extern int bar (void);
int
main ()
{
return bar ();
}

View File

@ -0,0 +1,7 @@
extern __thread int foo;
int
bar (void)
{
return foo;
}

View File

@ -0,0 +1 @@
__thread int foo;