]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-selective/3.cc
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-selective / 3.cc
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() { }