Add gcc.dg/tree-ssa/modref-3.c testcase
* gcc.dg/tree-ssa/modref-3.c: New test.
This commit is contained in:
parent
c34db4b6f8
commit
a1f77106ec
1 changed files with 31 additions and 0 deletions
31
gcc/testsuite/gcc.dg/tree-ssa/modref-3.c
Normal file
31
gcc/testsuite/gcc.dg/tree-ssa/modref-3.c
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
struct a
|
||||
{
|
||||
int b;
|
||||
int c;
|
||||
};
|
||||
|
||||
__attribute__ ((noclone, noinline))
|
||||
void
|
||||
test (struct a *a)
|
||||
{
|
||||
a->b = 2;
|
||||
}
|
||||
int
|
||||
foo ()
|
||||
{
|
||||
struct a a = {113,114};
|
||||
test (&a);
|
||||
return a.c;
|
||||
}
|
||||
int
|
||||
foo2 (struct a *a)
|
||||
{
|
||||
a->b = 123;
|
||||
a->c = 124;
|
||||
test (a);
|
||||
return a->c;
|
||||
}
|
||||
/* { dg-final { scan-tree-dump "return 114" "optimized"} } */
|
||||
/* { dg-final { scan-tree-dump "return 124" "optimized"} } */
|
Loading…
Add table
Reference in a new issue