This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/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() { } // lose
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 #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
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
40 extern "C" void __main() { }
This page took 0.030934 seconds and 5 git commands to generate.