Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | struct A |
2 | { | |
3 | virtual void foo(); | |
4 | virtual void bar(); | |
5 | }; | |
6 | ||
7 | void A::foo() { } // keep | |
8 | void A::bar() { } // loose | |
9 | ||
10 | struct B : public A | |
11 | { | |
12 | virtual void foo(); | |
13 | }; | |
14 | ||
15 | void B::foo() { } // keep | |
16 | ||
17 | void _start() __asm__("_start"); // keep | |
18 | ||
19 | A a; // keep | |
20 | B b; | |
21 | A *getme() { return &a; } // keep | |
22 | ||
23 | void _start() | |
24 | { | |
25 | getme()->foo(); | |
26 | } | |
27 | ||
28 | // In addition, keep A's virtual table. | |
29 | ||
30 | // We'll wind up keeping `b' and thus B's virtual table because | |
31 | // `a' and `b' are both referenced from the constructor function. | |
32 | ||
33 | extern "C" void __main() { } |