mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-19 07:13:40 +08:00
6d636d8c77
Weak defined function is turned into non-weak defined function by "ld -r -flto" with GCC 5 due to a GCC 5 regression: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67548 Add "ld -r" tests for PR ld/15323 to make sure that any linker change won't introduce linker regression for PR ld/15323. * ld-plugin/lto.exp (lto_link_tests): Add a "ld -r" test for PR ld/15323. (lto_run_tests): Add a "ld -r" test for PR ld/15323.
24 lines
254 B
C
24 lines
254 B
C
#include <stdio.h>
|
|
|
|
int x;
|
|
int y;
|
|
|
|
__attribute__((weak))
|
|
void foobar (void) { y++; x++; }
|
|
|
|
int main (void)
|
|
{
|
|
foobar ();
|
|
if (y == 0)
|
|
{
|
|
if (x == -1)
|
|
printf ("OK\n");
|
|
}
|
|
else
|
|
{
|
|
if (x == 1)
|
|
printf ("OK\n");
|
|
}
|
|
return 0;
|
|
}
|