* Makefile.tpl: Clean $(BUILD_SUBDIR).
[deliverable/binutils-gdb.git] / ld / testsuite / ld-selective / 3.cc
CommitLineData
252b5132
RH
1struct A
2{
3 virtual void foo();
4 virtual void bar();
5};
6
7void A::foo() { } // keep
62043cea 8void A::bar() { } // lose
252b5132
RH
9
10struct B : public A
11{
12 virtual void foo();
13};
14
15void B::foo() { } // keep
16
17void _start() __asm__("_start"); // keep
18
19A a; // keep
20B b;
21A *getme() { return &a; } // keep
22
23void _start()
24{
25 getme()->foo();
62043cea
AM
26#ifdef __GNUC__
27#if (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
28// gcc-2.95.2 gets this test wrong, and loses B::foo().
29// Cheat. After all, we aren't trying to test the compiler here.
30 b.foo();
31#endif
32#endif
252b5132
RH
33}
34
35// In addition, keep A's virtual table.
36
37// We'll wind up keeping `b' and thus B's virtual table because
38// `a' and `b' are both referenced from the constructor function.
39
40extern "C" void __main() { }
This page took 0.234082 seconds and 4 git commands to generate.