.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / type-inheritance-1.C
blobd4f3f67d3d66a08ae7d9de62510df89bc600c435
1 /* Verify that callgraph construction keeps FOO for possible devirtualization
2    and removes BAR.  */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -fdump-ipa-visibility"  } */
6 extern "C" void abort (void);
8 class A
10 public:
11   virtual int foo (void)
12      {
13         return 4;
14      }
15   virtual int bar (void)
16      {
17         return 5;
18      }
22 int t(class A *a)
24   return a->foo();
26 /* { dg-final { scan-ipa-dump "A::foo"  "visibility"  } } */
27 /* { dg-final { scan-ipa-dump-not "A::bar"  "visibility"  } } */