diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c new file mode 100644 index 000000000..ab4182246 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-ccp1" } */ + +struct f { int i; }; +int g() +{ + struct f a, *a1; + int *i; + a.i = 1; + a1 = &a; + i = &a1->i; + return *i; /* This should be turned into a.i */ +} + +/* { dg-final { scan-tree-dump "= a.i;" "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ |