This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Introduce mangle_assembler_name hook, resolve parts of PR43157, PR46674.


On Fri, Dec 10, 2010 at 01:08:07PM +0000, Dave Korn wrote:
> gcc/testsuite/ChangeLog:
> 
> 2010-12-10  Dave Korn  <...
> 
> 	PR middle-end/46674
> 	PR lto/43157
> 	* gcc.dg/pr43157.c: New file.
> 
> --- gcc/testsuite/gcc.dg/pr43157.c	(revision 0)
> +++ gcc/testsuite/gcc.dg/pr43157.c	(revision 0)
> @@ -0,0 +1,19 @@
> +/* { dg-do link } */
> +/* { dg-require-effective-target lto } */
> +/* { dg-options "-O1 -flto -fuse-linker-plugin" } */
> +
> +#define LABEL3(pfx, x) # pfx x
> +#define LABEL2(pfx, x) LABEL3(pfx, x)
> +#define LABEL(x) LABEL2(__USER_LABEL_PREFIX__, x)
> +
> +unsigned int factorial_ (unsigned int) __asm__ (LABEL ("factorial"));
> +
> +unsigned int factorial (unsigned int i)
> +{
> +  return i > 1 ? i * factorial_ (i - 1) : 1;
> +}
> +
> +int main (void)
> +{
> +  return factorial (5);
> +}

The testcase fails when using GLD which doesn't support plugins.
I guess you want
/* { dg-require-linker-plugin "" } */

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]