http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00110.html
[official-gcc.git] / gcc / testsuite / g++.dg / tree-prof / indir-call-prof.C
blob98ab302663fd3e0d4f23193850501f474be90363
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
3 struct A {
4   A () {}
6   virtual int AA (void)
7   { return 0; }
9 };
11 struct B : public A {
12   B () {}
14   virtual int AA (void)
15   { return 1; }
18 int
19 main (void)
21   A a;
22   B b;
23   
24   A* p;
26   p = &a;
27   p->AA ();
29   p = &b;
30   p->AA ();
31   
32   return 0;
35 /* { dg-final-use { scan-tree-dump "Indirect call -> direct call.* AA transformation on insn" "tree_profile"} } */
36 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */                                                                                
37 /* { dg-final-use { cleanup-tree-dump "optimized" } } */                                                                                              
38 /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */