Add missing test from last commit

Fixup two existing C++ tests for SCCVN changes

From-SVN: r126187
This commit is contained in:
Daniel Berlin 2007-07-02 04:55:48 +00:00
parent 8b0a512570
commit 908bd465fc
3 changed files with 42 additions and 4 deletions

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-O2 -fstrict-aliasing -fdump-tree-lim-details" }
// { dg-options "-O2 -fstrict-aliasing -fdump-tree-pre-details" }
// Make sure we hoist invariants out of the loop even in the presence
// of placement new. This is similar to code in tramp3d.
@ -69,5 +69,5 @@ int c::foo(int f1, int f2, int f3)
return sum;
}
// { dg-final { scan-tree-dump "Moving statement\\n.*->ai\\\[0\\\];\\n.*out of loop" "lim" } }
// { dg-final { cleanup-tree-dump "lim" } }
// { dg-final { scan-tree-dump "Replaced.*->ai\\\[0\\\]" "pre" } }
// { dg-final { cleanup-tree-dump "pre" } }

View File

@ -17,5 +17,5 @@ int foo(Foo& f)
return f.get();
}
/* { dg-final { scan-tree-dump "return f->x;" "optimized" } } */
/* { dg-final { scan-tree-dump "return f->x;" "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */

View File

@ -0,0 +1,38 @@
struct list_head {
struct list_head *next, *prev;
};
struct ib_fmr {
int *device;
struct list_head list;
};
static inline
struct mthca_fmr *to_mfmr(struct ib_fmr *ibmr)
{
const struct ib_fmr *__mptr = (ibmr);
return (struct mthca_fmr *)( (char *)__mptr );
}
void mthca_unmap_fmr(struct list_head *fmr_list)
{
struct ib_fmr *fmr;
if (mthca_is_memfree())
{
for (fmr =
({ const struct list_head *__mptr = ((fmr_list)->next); (struct ib_fmr *)(
(char *)__mptr - 8 );});
&fmr->list != (fmr_list);
fmr = ({ const struct list_head *__mptr = (fmr->list.next); (struct ib_fmr
*)( (char *)__mptr - 8);})
)
mthca_arbel_fmr_unmap(to_mfmr(fmr));
}
else
for (fmr =
({ const struct list_head *__mptr = ((fmr_list)->next); (struct ib_fmr *)(
(char *)__mptr - 8);});
&fmr->list != (fmr_list);
fmr = ({ const struct list_head *__mptr = (fmr->list.next); (struct ib_fmr
*)( (char *)__mptr - 8);})
)
mthca_tavor_fmr_unmap(to_mfmr(fmr));
}