aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/devirt4.C
blob: 5a24eecbd0ab401f8089bbdea9a0351ba12be2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR lto/53808
// Devirtualization + inlining should produce a non-virtual
// call to ~foo.
// { dg-options "-O -fdevirtualize" }
// { dg-final { scan-assembler "_ZN3fooD2Ev" } }

struct foo {
 virtual ~foo();
};
struct bar : public foo {
 virtual void zed();
};
void f() {
 foo *x(new bar);
 delete x;
}