OSDN Git Service

libcpp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / tree-prof / indir-call-prof.C
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
2
3 struct A {
4   A () {}
5
6   virtual int AA (void)
7   { return 0; }
8
9 };
10
11 struct B : public A {
12   B () {}
13
14   virtual int AA (void)
15   { return 1; }
16 };
17
18 int
19 main (void)
20 {
21   A a;
22   B b;
23   
24   A* p;
25
26   p = &a;
27   p->AA ();
28
29   p = &b;
30   p->AA ();
31   
32   return 0;
33 }
34
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" } } */                                                                                           
39