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:
parent
ada353b879
commit
a8d2d89de2
3 changed files with 53 additions and 0 deletions
14
gcc/testsuite/gcc.dg/lto/modref-1_0.c
Normal file
14
gcc/testsuite/gcc.dg/lto/modref-1_0.c
Normal 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;
|
||||
}
|
13
gcc/testsuite/gcc.dg/lto/modref-1_1.c
Normal file
13
gcc/testsuite/gcc.dg/lto/modref-1_1.c
Normal 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;
|
||||
}
|
26
gcc/testsuite/gcc.dg/tree-ssa/modref-2.c
Normal file
26
gcc/testsuite/gcc.dg/tree-ssa/modref-2.c
Normal 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue