Commit 0adad9c5 by Jan Hubicka Committed by Jan Hubicka

* g++.dg/ipa/devirt-15.C: New testcase.

From-SVN: r202153
parent d775b5ea
2013-09-01 Jan Hubicka <jh@suse.cz>
* g++.dg/ipa/devirt-15.C: New testcase.
2013-09-01 Eric Botcazou <ebotcazou@adacore.com> 2013-09-01 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/linker_alias.ads: Skip on Darwin. * gnat.dg/specs/linker_alias.ads: Skip on Darwin.
......
/* Check that we speculatively devirutalize call to FOO to B::foo becuase
A is noreturn. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-devirt" } */
class A {
public:
virtual int foo(void)
{
throw (1);
return 0;
}
};
class B : public A {
public:
virtual int foo(void);
};
int
B::foo(void)
{
return 1;
}
class A a, *b=&a;
void
m(void)
{
b->foo();
}
main()
{
m();
}
/* { dg-final { scan-ipa-dump "Speculatively devirtualizing call" "devirt"} } */
/* { dg-final { cleanup-ipa-dump "devirt" } } */
/* Match if (PROF_6 == foo) to verify that the speculation survived. */
/* { dg-final { scan-tree-dump "== foo" "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment