binutils-gdb/ld/testsuite/ld-plugin/lto-18a.c
Alan Modra fb7331ae2b lto-18 test
Demonstrates a reason to use IR symbols when deciding an --as-needed
library should be loaded.

	* testsuite/ld-plugin/lto-18a.c,
	* testsuite/ld-plugin/lto-18b.c,
	* testsuite/ld-plugin/lto-18c.c,
	* testsuite/ld-plugin/lto-18d.c,
	* testsuite/ld-plugin/lto-18.out: New test.
	* testsuite/ld-plugin/lto.exp: Run it.
2020-09-09 12:36:59 +09:30

23 lines
319 B
C

#include <stdio.h>
extern int select ();
extern int f1 (int);
extern int f2 (int);
int main (void)
{
switch (select ())
{
case 1:
printf ("%d\n", f1 (3));
break;
case 2:
printf ("%d\n", f2 (4));
break;
default:
printf ("%d\n", f2 (0));
break;
}
return 0;
}