Add modref testcases

gcc/testsuite/

	* gcc.dg/lto/modref-1_0.c: New test.
	* gcc.dg/lto/modref-1_1.c: New test.
	* gcc.dg/tree-ssa/modref-2.c: New test.
This commit is contained in:
Jan Hubicka 2020-09-26 10:44:53 +02:00
parent ada353b879
commit a8d2d89de2
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,14 @@
/* { dg-lto-do run } */
/* { dg-lto-options {"-O2 -flto-partition=max -flto"} } */
extern void recursive (int *a, int *b, int *c, int level);
int
main()
{
int x = 123, y=124, z=125;
recursive (&x,&y,&z,1);
if (y)
__builtin_abort ();
if (!__builtin_constant_p (z))
__builtin_abort ();
return 0;
}

View file

@ -0,0 +1,13 @@
short aa;
void
__attribute__ ((noinline, noclone))
recursive (int *a, int *b, int *c, int level)
{
if (level && c)
{
recursive (b,a,c,0);
aa++;
}
else
*a=0;
}

View file

@ -0,0 +1,26 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
short aa;
void
__attribute__ ((noinline, noclone))
recursive (int *a, int *b, int *c, int level)
{
if (level && c)
{
recursive (b,a,c,0);
aa++;
}
else
*a=0;
}
int
main()
{
int x = 123, y=124, z=125;
recursive (&x,&y,&z,1);
if (y)
__builtin_abort ();
if (!__builtin_constant_p (z))
__builtin_abort ();
return 0;
}